Skip to content

Commit

Permalink
fix(ledger): unsupported browser modal not opening
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranjamie committed Jul 12, 2022
1 parent edd5c48 commit e78864b
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions src/app/pages/onboarding/welcome/welcome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,18 @@ export const WelcomePage = memo(() => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

const supportsWebUsbAction = whenPageMode({
full() {
navigate(RouteUrls.ConnectLedger);
},
popup() {
void openIndexPageInNewTab(`${RouteUrls.Onboarding}/${RouteUrls.ConnectLedger}`);
},
});
const pageModeRoutingAction = (url: RouteUrls) =>
whenPageMode({
full() {
navigate(url);
},
popup() {
void openIndexPageInNewTab(`${RouteUrls.Onboarding}/${url}`);
},
});

const doesNotSupportWebUsbAction = whenPageMode({
full: navigate as any,
popup: openIndexPageInNewTab,
});
const supportsWebUsbAction = pageModeRoutingAction(RouteUrls.ConnectLedger);
const doesNotSupportWebUsbAction = pageModeRoutingAction(RouteUrls.LedgerUnsupportedBrowser);

return (
<WelcomeLayout
Expand Down

0 comments on commit e78864b

Please sign in to comment.