Skip to content

Commit

Permalink
fix: sign out of the wallet before proceeding with ledger sign in
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarkhanzadian committed Jan 26, 2024
1 parent 62bf0ec commit aa214c8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/app/pages/onboarding/welcome/welcome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<>
<WelcomeLayout
tagline="Bitcoin for the rest of us"
subheader="Leather is the only Bitcoin wallet you need to tap into the emerging Bitcoin economy"
isGeneratingWallet={isGeneratingWallet}
onSelectConnectLedger={() =>
doesBrowserSupportWebUsbApi() ? supportsWebUsbAction() : doesNotSupportWebUsbAction()
}
onSelectConnectLedger={onSelectConnectLedger}
onStartOnboarding={() => startOnboarding()}
onRestoreWallet={() => restoreWallet()}
/>
Expand Down

0 comments on commit aa214c8

Please sign in to comment.