From aa214c8450fcef7e9a86fa2648f389e68a741120 Mon Sep 17 00:00:00 2001 From: Edgar Khanzadian Date: Fri, 26 Jan 2024 19:40:48 +0400 Subject: [PATCH] fix: sign out of the wallet before proceeding with ledger sign in --- src/app/pages/onboarding/welcome/welcome.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/app/pages/onboarding/welcome/welcome.tsx b/src/app/pages/onboarding/welcome/welcome.tsx index fae11bd2dc8..b513e63bcaf 100644 --- a/src/app/pages/onboarding/welcome/welcome.tsx +++ b/src/app/pages/onboarding/welcome/welcome.tsx @@ -67,15 +67,22 @@ export function WelcomePage() { const restoreWallet = pageModeRoutingAction(RouteUrls.SignIn); + const onSelectConnectLedger = useCallback(async () => { + await keyActions.signOut(); + if (doesBrowserSupportWebUsbApi()) { + supportsWebUsbAction(); + } else { + doesNotSupportWebUsbAction(); + } + }, [doesNotSupportWebUsbAction, keyActions, supportsWebUsbAction]); + return ( <> - doesBrowserSupportWebUsbApi() ? supportsWebUsbAction() : doesNotSupportWebUsbAction() - } + onSelectConnectLedger={onSelectConnectLedger} onStartOnboarding={() => startOnboarding()} onRestoreWallet={() => restoreWallet()} />