MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / readPersistedUiState

Function readPersistedUiState

packages/client/src/app/uiState.ts:72–85  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

70}
71
72export function readPersistedUiState(): PersistedUiState {
73 if (typeof window === "undefined") {
74 return {};
75 }
76
77 try {
78 const parsed = JSON.parse(
79 window.localStorage.getItem(UI_STATE_STORAGE_KEY) ?? "{}",
80 ) as PersistedUiState;
81 return sanitizePersistedUiState(parsed);
82 } catch {
83 return {};
84 }
85}
86
87export function clearLegacyVolatileUiState(): void {
88 if (typeof window === "undefined") {

Callers 2

AppShellFunction · 0.90
writePersistedUiStateFunction · 0.85

Calls 2

sanitizePersistedUiStateFunction · 0.85
parseMethod · 0.45

Tested by

no test coverage detected