Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: dismiss all before returning home #227

Merged
merged 4 commits into from
Dec 24, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions pages/settings/wallets/SetupWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ export function SetupWallet() {
position: "top",
});

router.replace("/");
if (router.canDismiss()) {
router.dismissAll();
}
router.navigate("/");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this navigation even needed if we dismiss all the routes? shouldn't this be the default?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this also push a route onto the stack, leaving a back button?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Navigate actually goes to "/" if available (which is actually the only screen in the stack after dismissAll), so it doesn't add a back button

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this navigation even needed if we dismiss all the routes? shouldn't this be the default?

Makes sense, removed navigation

};

React.useEffect(() => {
Expand Down Expand Up @@ -161,7 +164,10 @@ export function SetupWallet() {
useAppStore
.getState()
.setSelectedWalletId(walletIdWithConnection);
router.replace("/");
if (router.canDismiss()) {
router.dismissAll();
}
router.navigate("/");
}}
>
<X className="text-foreground" />
Expand Down
Loading