fix(wallet): dont show error state if user rejects connection (#4901)

Co-authored-by: Madalina Raicu <madalina@raygroup.uk>
This commit is contained in:
Matthew Russell 2023-10-03 07:21:19 -04:00 committed by GitHub
parent 60ca6c2eb6
commit 872f1d300f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -131,7 +131,12 @@ const Error = ({
);
if (error) {
if (error.message === InjectedConnectorErrors.INVALID_CHAIN.message) {
if (error.message === InjectedConnectorErrors.USER_REJECTED.message) {
title = t('User rejected');
text = t('The user rejected the wallet connection');
} else if (
error.message === InjectedConnectorErrors.INVALID_CHAIN.message
) {
title = t('Wrong network');
text = t(
'To complete your wallet connection, set your wallet network in your app to "%s".',

View File

@ -42,6 +42,7 @@ declare global {
}
export const InjectedConnectorErrors = {
USER_REJECTED: new Error('Connection denied'),
VEGA_UNDEFINED: new Error('window.vega not found'),
INVALID_CHAIN: new Error('Invalid chain'),
};