From 3885348f9753bda950e92d23dcd43d52a126cdee Mon Sep 17 00:00:00 2001 From: AdrienLSH Date: Mon, 29 Jan 2024 10:16:06 +0100 Subject: [PATCH] improved login redirections --- frontend/static/js/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/static/js/index.js b/frontend/static/js/index.js index 7af76b6..ba91509 100644 --- a/frontend/static/js/index.js +++ b/frontend/static/js/index.js @@ -108,14 +108,16 @@ const router = async(uri) => { if (lastView !== undefined) await lastView.leavePage(); + if (uri !== '/login' && uri !== '/register' && uri !== '/logout') + lastPageUrlBeforeLogin = uri; + else + lastPageUrlBeforeLogin = undefined; const view = new match.route.view(getParams(match), lastPageUrlBeforeLogin); if (view instanceof AbstractRedirectView && await view.redirect()) return 1; lastView = view; - if (uri !== '/login' && uri !== '/register' && uri !== '/logout') - lastPageUrlBeforeLogin = uri; if (await renderView(view)) return 1;