From ea427394b2003d0f78ea0e1244b27602a17bc471 Mon Sep 17 00:00:00 2001 From: Gancho Radkov <43912948+ganchoradkov@users.noreply.github.com> Date: Wed, 9 Oct 2024 16:02:15 +0300 Subject: [PATCH] feat: shows error toast when approve rejects (#171) --- .../rn_cli_wallet/src/modals/SessionProposalModal.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wallets/rn_cli_wallet/src/modals/SessionProposalModal.tsx b/wallets/rn_cli_wallet/src/modals/SessionProposalModal.tsx index eb17f9e9..dca6347b 100644 --- a/wallets/rn_cli_wallet/src/modals/SessionProposalModal.tsx +++ b/wallets/rn_cli_wallet/src/modals/SessionProposalModal.tsx @@ -16,6 +16,7 @@ import {Chains} from '@/components/Modal/Chains'; import {EIP155_CHAINS, EIP155_SIGNING_METHODS} from '@/utils/PresetsUtil'; import {RequestModal} from './RequestModal'; import {getSupportedChains} from '@/utils/HelperUtil'; +import Toast from 'react-native-toast-message'; export default function SessionProposalModal() { const Theme = useTheme(); @@ -78,9 +79,7 @@ export default function SessionProposalModal() { id: proposal.id, namespaces, }); - SettingsStore.setSessions( - Object.values(walletKit.getActiveSessions()), - ); + SettingsStore.setSessions(Object.values(walletKit.getActiveSessions())); handleRedirect({ peerRedirect: session.peer.metadata.redirect, @@ -88,7 +87,10 @@ export default function SessionProposalModal() { }); } catch (e) { console.log((e as Error).message, 'error'); - return; + Toast.show({ + type: 'error', + text1: (e as Error).message, + }); } } setIsLoadingApprove(false);