| 85 | } |
| 86 | |
| 87 | export function clearLegacyVolatileUiState(): void { |
| 88 | if (typeof window === "undefined") { |
| 89 | return; |
| 90 | } |
| 91 | |
| 92 | try { |
| 93 | const parsed = JSON.parse( |
| 94 | window.localStorage.getItem(UI_STATE_STORAGE_KEY) ?? "{}", |
| 95 | ) as PersistedUiState; |
| 96 | if (parsed.search != null) { |
| 97 | delete parsed.search; |
| 98 | window.localStorage.setItem(UI_STATE_STORAGE_KEY, JSON.stringify(parsed)); |
| 99 | } |
| 100 | } catch { |
| 101 | window.localStorage.removeItem(UI_STATE_STORAGE_KEY); |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | export function readStoredAccessibilitySource(): AccessibilitySourcePreference { |
| 106 | if (typeof window === "undefined") { |