From 1cb2f88f2b3c0e9521d781f722bf29455e827172 Mon Sep 17 00:00:00 2001 From: Alberto Gualis Date: Tue, 3 Sep 2024 10:09:59 +0200 Subject: [PATCH] fix: avoid hard reload of edit votes page (#5899) --- src/plugins/router/nav-guards.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugins/router/nav-guards.ts b/src/plugins/router/nav-guards.ts index bb1a230e29..275df2fc9d 100644 --- a/src/plugins/router/nav-guards.ts +++ b/src/plugins/router/nav-guards.ts @@ -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}`); };