Skip to content

Commit

Permalink
fix: sign out and close all tabs on create wallet, closes #4517
Browse files Browse the repository at this point in the history
  • Loading branch information
pete-watters committed Nov 22, 2023
1 parent 0742719 commit 0b47dea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
18 changes: 8 additions & 10 deletions src/app/pages/onboarding/welcome/welcome.layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@ interface WelcomeLayoutProps {
onStartOnboarding(): void;
onRestoreWallet(): void;
}
export function WelcomeLayout(props: WelcomeLayoutProps): React.JSX.Element {
const {
tagline,
subheader,
isGeneratingWallet,
onStartOnboarding,
onSelectConnectLedger,
onRestoreWallet,
} = props;

export function WelcomeLayout({
tagline,
subheader,
isGeneratingWallet,
onStartOnboarding,
onSelectConnectLedger,
onRestoreWallet,
}: WelcomeLayoutProps): React.JSX.Element {
const isAtleastBreakpointMd = useViewportMinWidth('md');

return (
Expand Down
3 changes: 2 additions & 1 deletion src/app/pages/onboarding/welcome/welcome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ export function WelcomePage() {
const [isGeneratingWallet, setIsGeneratingWallet] = useState(false);

useRouteHeader(<></>);

const startOnboarding = useCallback(async () => {
if (isPopupMode()) {
openIndexPageInNewTab(RouteUrls.Onboarding);
closeWindow();
return;
}
setIsGeneratingWallet(true);
// #4517 signout other tabs on wallet create
await keyActions.signOut();
keyActions.generateWalletKey();
void analytics.track('generate_new_secret_key');
if (decodedAuthRequest) {
Expand Down

0 comments on commit 0b47dea

Please sign in to comment.