From 263145d4f937260b6b66f079b6c82a5de0577f48 Mon Sep 17 00:00:00 2001 From: Tolu Lawson <55362043+tolulawson@users.noreply.github.com> Date: Wed, 18 Dec 2024 16:58:55 -0700 Subject: [PATCH] Refactor wallet dispatch logic to include SELECT_WALLET action after sign-in --- views/Auth/ResetWallet.js | 10 +++++++++- views/Onboarding/CreateWallet.js | 4 ++++ views/Onboarding/ImportWallet.js | 10 +++++++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/views/Auth/ResetWallet.js b/views/Auth/ResetWallet.js index 86eb7d31..d8ed4bc5 100644 --- a/views/Auth/ResetWallet.js +++ b/views/Auth/ResetWallet.js @@ -15,7 +15,15 @@ export const ResetWallet = () => { ({ authenticated, wallet }) => { dispatch({ type: DISPATCH_TYPES.SIGN_IN, - payload: { authenticated, wallet, navigate: 'Success' }, + payload: { + authenticated, + wallet, + navigate: 'Success', + }, + }); + dispatch({ + type: DISPATCH_TYPES.SELECT_WALLET, + payload: { index: 0 }, }); }, [dispatch] diff --git a/views/Onboarding/CreateWallet.js b/views/Onboarding/CreateWallet.js index 515a994b..1bccca09 100644 --- a/views/Onboarding/CreateWallet.js +++ b/views/Onboarding/CreateWallet.js @@ -93,6 +93,10 @@ export const CreateWallet = () => { navigate: '/Success', }, }); + dispatch({ + type: DISPATCH_TYPES.SELECT_WALLET, + payload: { index: 0 }, + }); dispatch({ type: DISPATCH_TYPES.SET_ONBOARDING_COMPLETE, payload: true, diff --git a/views/Onboarding/ImportWallet.js b/views/Onboarding/ImportWallet.js index 5542b74b..ebeda129 100644 --- a/views/Onboarding/ImportWallet.js +++ b/views/Onboarding/ImportWallet.js @@ -16,7 +16,15 @@ export const ImportWallet = () => { ({ authenticated, wallet }) => { dispatch({ type: DISPATCH_TYPES.SIGN_IN, - payload: { authenticated, wallet, navigate: '/Success' }, + payload: { + authenticated, + wallet, + navigate: '/Success', + }, + }); + dispatch({ + type: DISPATCH_TYPES.SELECT_WALLET, + payload: { index: 0 }, }); dispatch({ type: DISPATCH_TYPES.SET_ONBOARDING_COMPLETE,