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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user