From a4116388062a0eb6abf538699449ffde402387bd Mon Sep 17 00:00:00 2001 From: MaryWylde Date: Fri, 7 Aug 2026 21:27:33 +0200 Subject: [PATCH] fix(uxcore): persist new-update modal dismissal across tabs and restarts sessionStorage is per-tab, so closing the tab brought the modal back; localStorage keeps it dismissed until a new update is published in the CMS. Co-Authored-By: Claude Opus 4.7 --- .../components/NewUpdateModal/NewUpdateModalContainer.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/uxcore/components/NewUpdateModal/NewUpdateModalContainer.tsx b/src/uxcore/components/NewUpdateModal/NewUpdateModalContainer.tsx index 8634b58..1b823f6 100644 --- a/src/uxcore/components/NewUpdateModal/NewUpdateModalContainer.tsx +++ b/src/uxcore/components/NewUpdateModal/NewUpdateModalContainer.tsx @@ -25,8 +25,8 @@ const NewUpdateModalContainer: FC = () => { if (cancelled || !res || !res['Frontend modal visibility']) return; // Dismissal is keyed to the CMS updatedAt: closing hides this update - // for the rest of the session, but a newly published one shows again. - if (sessionStorage.getItem(DISMISSED_KEY) === (res.updatedAt ?? 'seen')) + // until site data is cleared, but a newly published one shows again. + if (localStorage.getItem(DISMISSED_KEY) === (res.updatedAt ?? 'seen')) return; setData(res); @@ -52,7 +52,7 @@ const NewUpdateModalContainer: FC = () => { const handleClose = () => { setOpen(false); try { - sessionStorage.setItem(DISMISSED_KEY, data?.updatedAt ?? 'seen'); + localStorage.setItem(DISMISSED_KEY, data?.updatedAt ?? 'seen'); } catch { // Storage can be unavailable (private mode); closing still works. }