(changes: Record<string, boolean>)
| 124 | * deletes the key (clearing the unread dot). |
| 125 | */ |
| 126 | export function saveUnread(changes: Record<string, boolean>): void { |
| 127 | const current = loadUnread(); |
| 128 | const merged: Record<string, boolean> = { ...current }; |
| 129 | for (const [id, value] of Object.entries(changes)) { |
| 130 | if (value) merged[id] = true; |
| 131 | else delete merged[id]; |
| 132 | } |
| 133 | safeSetString(STORAGE_KEYS.unread, JSON.stringify(merged)); |
| 134 | } |
| 135 | |
| 136 | /** |
| 137 | * Collapsed workspace ids in the sidebar. Persisted as a JSON array of ids so |
no test coverage detected