refactor(ui): parse the scoped theme entry at the boundary; runtime-switch owns transient keys
The scoped theme entry is now parsed by one boundary parser with a stated invariant instead of ad hoc typeof narrowing, and the runtime keys that mean "no instance connected" live next to the code that produces them so a new sentinel cannot miss the theme-storage guard.
This commit is contained in:
@@ -5,12 +5,12 @@ import { DEFAULT_DARK_THEME_ID, DEFAULT_LIGHT_THEME_ID } from '@/lib/theme/theme
|
||||
import {
|
||||
adoptThemePreferencesForRuntime,
|
||||
getThemePreferencesStorageKey,
|
||||
isTransientRuntimeKey,
|
||||
readThemePreferencesForRuntime,
|
||||
resolveThemePreferencesForRuntime,
|
||||
resolveThemePreferencesFromStorageEvent,
|
||||
writeThemePreferencesForRuntime,
|
||||
} from './theme-storage';
|
||||
import { isTransientRuntimeKey } from '@/lib/runtime-switch';
|
||||
|
||||
let createdWindow = false;
|
||||
let createdLocalStorage = false;
|
||||
|
||||
Reference in New Issue
Block a user