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

fix: close ledger sheet in request keys flow #6024

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

alter-eggo
Copy link
Contributor

@alter-eggo alter-eggo commented Dec 18, 2024

Try out Leather build 3992286Extension build, Test report, Storybook, Chromatic

Fixed broken close ledger connect sheet


return (
<LedgerRequestKeysProvider value={context}>
<Sheet
isShowing
header={<SheetHeader />}
onClose={isActionCancellableByUser ? onCancelConnectLedger : undefined}
onClose={isActionCancellableByUser ? () => navigate(RouteUrls.Home) : undefined}
Copy link
Contributor

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

Copy link
Collaborator

@kyranjamie kyranjamie left a 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

@kyranjamie
Copy link
Collaborator

The routes for the ledger flows are such that /stacks/ or /bitcoin by themselves are not valid. What other ways can we ensure users do land on those routes?

Base automatically changed from feat/display-sbtc to dev December 18, 2024 16:24
const baseUrl = `/${location.pathname.split('/')[1]}`;

return navigate(baseUrl, {
return navigate('..', {
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants