Skip to content

Commit

Permalink
fix: path change issue
Browse files Browse the repository at this point in the history
  • Loading branch information
AMIRKHANEF committed Nov 26, 2024
1 parent 83331b0 commit db72b57
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/extension-ui/src/Popup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default function Popup (): React.ReactElement {
const genesisHashOptionsCtx = useGenesisHashOptions();
const workerRef = useRef<Worker | undefined>(undefined);

useLocation();// just to trigger component to fix forgot pass issue
const { pathname } = useLocation(); // also to trigger component to fix forgot pass issue

const [accountCtx, setAccountCtx] = useState<AccountsContext>({ accounts: [], hierarchy: [] });
const [userAddedChainCtx, setUserAddedChainCtx] = useState<UserAddedChains>({});
Expand Down Expand Up @@ -112,8 +112,10 @@ export default function Popup (): React.ReactElement {
_onAction('/metadata');
} else if (signRequests.length) {
_onAction('/signing');
} else if (['/authorize', '/metadata', '/signing'].includes(pathname)) {
_onAction('/');
}
}, [_onAction, authRequests, authRequests?.length, metaRequests, metaRequests?.length, signRequests, signRequests?.length]);
}, [_onAction, authRequests, authRequests?.length, metaRequests, metaRequests?.length, pathname, signRequests, signRequests?.length]);

useEffect(() => {
workerRef.current = new Worker(new URL('../../../extension-polkagate/src/util/workers/sharedWorker.js', import.meta.url));
Expand Down

0 comments on commit db72b57

Please sign in to comment.