19 lines
538 B
TypeScript
19 lines
538 B
TypeScript
export function hasUserSettingsSyncFailure(storageKey: string): boolean {
|
|
if (typeof window === "undefined") return false;
|
|
try {
|
|
return window.localStorage.getItem(storageKey) === "1";
|
|
} catch {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
export function setUserSettingsSyncFailure(storageKey: string, failed: boolean): void {
|
|
if (typeof window === "undefined") return;
|
|
try {
|
|
if (failed) window.localStorage.setItem(storageKey, "1");
|
|
else window.localStorage.removeItem(storageKey);
|
|
} catch {
|
|
/* ignore storage failures */
|
|
}
|
|
}
|