(pubkey: string, rootIds: Set<string>)
| 17 | } |
| 18 | }, |
| 19 | write(pubkey: string, rootIds: Set<string>): void { |
| 20 | try { |
| 21 | const arr = [...rootIds]; |
| 22 | const capped = |
| 23 | arr.length > maxEntries ? arr.slice(arr.length - maxEntries) : arr; |
| 24 | window.localStorage.setItem(storageKey(pubkey), JSON.stringify(capped)); |
| 25 | } catch { |
| 26 | // Ignore storage errors (private browsing, quota exceeded). |
| 27 | } |
| 28 | }, |
| 29 | }; |
| 30 | } |