fix(notifications): keep the history under a key of its own, so an older build never reads its new shape

A build from before the change renders history rows as text; an object there crashed its
Notifications page after a rollback. The old key is read once while the new one does not exist,
and never written.
This commit is contained in:
2026-10-29 23:54:48 +01:00
parent e5c75702e8
commit cb8b99e0e7
4 changed files with 84 additions and 5 deletions
+3 -1
View File
@@ -222,7 +222,9 @@ let cachedUnread = 0;
function load(): Notification[] {
try {
const stored = readAccount<unknown>(HISTORY_KEY, []);
// The old key only until the new one exists: its rows carry forward, said text as `raw`.
const stored =
readAccount<unknown>(HISTORY_KEY, null) ?? readAccount<unknown>(LS.legacyNotifHistory, []);
if (!Array.isArray(stored)) return [];
// Restored entries are history only. Mark them dismissed so they don't
// resurrect as active toasts on reload — their auto-dismiss timers aren't