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 useRouteRedirects redirecting to active wallet #823

Open
lukaw3d opened this issue May 5, 2022 · 2 comments
Open

Fix useRouteRedirects redirecting to active wallet #823

lukaw3d opened this issue May 5, 2022 · 2 comments
Assignees

Comments

@lukaw3d
Copy link
Member

lukaw3d commented May 5, 2022

useRouteRedirects

This is tough. It was an effect in saga before (https://github.com/oasisprotocol/oasis-wallet-web/blob/5cebb40/src/app/state/wallet/saga.ts#L150) but saga now runs in background page.

One benefit of this is: when you open a popup with stored state, it redirects to your wallet.
One issue is: it always redirects. Even if you have chrome-extension://jplembhokmkioddbchbohdfkmjdmepbb/popup.html#/create-wallet open as a tab, and reload.

Use cases:

  • when active wallet changes, redirect to it
  • when clicking extension icon to open popup, redirect to active wallet (ideally use history.replace)
    • or (Tadej's preference) clicking extension icon to open popup redirects to last url (ideally use history.replace)
      (conflicts with "not to keep your routes in your Redux store at all" recommendation)
  • when reloading an existing popup, don't redirect
  • when opening popup with specific URL (e.g. to confirm dapp action), don't redirect

Originally posted by @lukaw3d in #787 (comment)

@lukaw3d lukaw3d changed the title Fix redirecting to active wallet Fix useRouteRedirects redirecting to active wallet May 12, 2022
@tjanez tjanez removed the internal label Sep 22, 2022
@lukaw3d
Copy link
Member Author

lukaw3d commented Oct 6, 2022

This will be more annoying after #975

@lukaw3d
Copy link
Member Author

lukaw3d commented Oct 9, 2023

Another issue to check after fixing this:

  • create wallet with account1 and account2 (selected)
  • open URL of account3
  • open account selector and try to open account2 (even tho it is already "selected")
  • it shouldn't keep showing account3

@lukaw3d lukaw3d mentioned this issue Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants