-
Notifications
You must be signed in to change notification settings - Fork 146
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
fix: close ledger sheet in request keys flow #6024
base: dev
Are you sure you want to change the base?
Conversation
|
||
return ( | ||
<LedgerRequestKeysProvider value={context}> | ||
<Sheet | ||
isShowing | ||
header={<SheetHeader />} | ||
onClose={isActionCancellableByUser ? onCancelConnectLedger : undefined} | ||
onClose={isActionCancellableByUser ? () => navigate(RouteUrls.Home) : undefined} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems OK but we have another method in ledgerNavigate
called cancelLedgerActionAndReturnHome
, maybe we can use that?
It seems like for some reason the code in cancelLedgerAction
doesn't catch the route you are on (maybe as it's a nested route) so you could also try and fix that to handle nested routes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't remove the handler and default to navigating home, that'll break flows in which the user isn't mean to visit home page, e.g. all the RPC flows
The routes for the ledger flows are such that |
ed39244
to
3992286
Compare
const baseUrl = `/${location.pathname.split('/')[1]}`; | ||
|
||
return navigate(baseUrl, { | ||
return navigate('..', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you track back to the PR where I changed it? I think changing it back to '..' will re-introduce this bug.
If you're confident this will work fair enough. I think the problem you hit is a new bug and could be solved by making the baseUrl
find the route you are on more accurately
Fixed broken close ledger connect sheet