Skip to content

Commit

Permalink
Allow keyring paths to override query param pages
Browse files Browse the repository at this point in the history
If the popup is presented for transaction signing, the keyrings must be
unlocked to proceed. Without this change, the router enters an infinite
loop as the query-param-based rerouting forces the route to transaction
signing, but the transaction signing component tries to reroute to the
keyring unlock screen.
  • Loading branch information
Shadowfiend committed Dec 13, 2021
1 parent 627630d commit e279cba
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ui/pages/Popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ function transformLocation(inputLocation: Location): Location {
const maybePage = params.get("page")

let { pathname } = inputLocation
if (isAllowedQueryParamPage(maybePage)) {
if (
isAllowedQueryParamPage(maybePage) &&
!inputLocation.pathname.includes("/keyring/")
) {
pathname = maybePage
}

Expand All @@ -45,8 +48,6 @@ function transformLocation(inputLocation: Location): Location {
}

export default function Popup({ store }: { store: Store }): ReactElement {
const history = useHistory()

return (
<Provider store={store}>
<Router>
Expand Down

0 comments on commit e279cba

Please sign in to comment.