From b83794c36115f0c0c874187852d4b20bc3c1a38a Mon Sep 17 00:00:00 2001 From: Sam Machin Date: Wed, 15 Apr 2026 18:08:17 +0100 Subject: [PATCH] don't remove storeAlertsLastViewed on logout (#594) --- src/router/auth.tsx | 2 +- src/store/localStore.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/router/auth.tsx b/src/router/auth.tsx index 0868f47..44d57ca 100644 --- a/src/router/auth.tsx +++ b/src/router/auth.tsx @@ -173,7 +173,7 @@ export const useProvideAuth = (): AuthStateContext => { } }) .catch((error) => { - localStorage.clear(); + clearLocalStorage(); sessionStorage.clear(); sessionStorage.setItem(SESS_FLASH_MSG, MSG_LOGGED_OUT); window.location.href = ROUTE_LOGIN; diff --git a/src/store/localStore.ts b/src/store/localStore.ts index 47b528c..2f6a68b 100644 --- a/src/store/localStore.ts +++ b/src/store/localStore.ts @@ -145,7 +145,7 @@ export const checkLocation = () => { }; export const clearLocalStorage = () => { - const toKeep = [storeActiveSP, storeAccountFilter]; + const toKeep = [storeActiveSP, storeAccountFilter, storeAlertsLastViewed]; Object.keys(localStorage).forEach((key) => { if (!toKeep.includes(key)) { localStorage.removeItem(key);