Skip to content

Commit

Permalink
fix: avoid hard reload of edit votes page
Browse files Browse the repository at this point in the history
  • Loading branch information
agualis committed Sep 2, 2024
1 parent aa3cfef commit 448023f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/plugins/router/nav-guards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ function applyNetworkPathRedirects(router: Router): Router {
if (networkFromPath) {
const noNetworkChangeCallback = () => next();
const networkChangeCallback = () => {
/*
Edge case:
Clicking a pool link from the voting page changes networkId in localStorage so we have to ignore the hardRedirect to avoid losing the voting state
(when navigating to Edit votes)
*/
if (to.fullPath === '/ethereum/vebal-voting') return next();
hardRedirectTo(`/#${to.fullPath}`);
};

Expand Down

0 comments on commit 448023f

Please sign in to comment.