From 1a95c8462add9f74ac5879facf21c8b9d03dd7c6 Mon Sep 17 00:00:00 2001 From: IsaccoSordo Date: Mon, 2 Sep 2024 10:46:01 +0200 Subject: [PATCH] fix: error message --- .../WalletConnectCommunicationClient.ts | 4 ++-- packages/beacon-ui/src/ui/alert/index.tsx | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/packages/beacon-transport-walletconnect/src/communication-client/WalletConnectCommunicationClient.ts b/packages/beacon-transport-walletconnect/src/communication-client/WalletConnectCommunicationClient.ts index 1e478315d..440ce8933 100644 --- a/packages/beacon-transport-walletconnect/src/communication-client/WalletConnectCommunicationClient.ts +++ b/packages/beacon-transport-walletconnect/src/communication-client/WalletConnectCommunicationClient.ts @@ -586,7 +586,7 @@ export class WalletConnectCommunicationClient extends CommunicationClient { const { uri, approval } = await signClient.connect({ ...connectParams }).catch((error) => { logger.error(`Init error: ${error.message}`) - localStorage && localStorage.setItem('beacon:wc-init-error', error.message) + localStorage && localStorage.setItem(StorageKey.WC_INIT_ERROR, error.message) throw new Error(error.message) }) @@ -1341,7 +1341,7 @@ export class WalletConnectCommunicationClient extends CommunicationClient { this.subscribeToSessionEvents(this.signClient) } catch (error: any) { logger.error(error.message) - localStorage && localStorage.setItem('beacon:wc-init-error', error.message) + localStorage && localStorage.setItem(StorageKey.WC_INIT_ERROR, error.message) return undefined } } diff --git a/packages/beacon-ui/src/ui/alert/index.tsx b/packages/beacon-ui/src/ui/alert/index.tsx index d2ef79a41..482ed4e96 100644 --- a/packages/beacon-ui/src/ui/alert/index.tsx +++ b/packages/beacon-ui/src/ui/alert/index.tsx @@ -459,12 +459,20 @@ const openAlert = async (config: AlertConfig): Promise => { } const generateWCError = (title: string) => { - const errorMessage = localStorage ? localStorage.getItem('beacon:wc-init-error') : undefined + const errorMessage = localStorage ? localStorage.getItem(StorageKey.WC_INIT_ERROR) : undefined const description: any = ( <> -

- A network error occurred. This issue is not caused by your wallet. -

+

A network error occurred.

+

+ This issue does not concern your wallet or dApp. If the problem persists, please report + it to Beacon{' '} + setCurrentInfo('help')} + > + here + +

{errorMessage && {errorMessage}} )