diff --git a/src/utils.ts b/src/utils.ts index 32e8e6d..f2c6692 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -113,7 +113,11 @@ function getSetting(name: T): Settings[T] { } try { - return (sessionStorage.getItem(name) as Settings[T]) || DEFAULT_USER_SETTINGS[name]; + if ((name as String) === "theme") { + return (localStorage.getItem(name) as Settings[T]) || DEFAULT_USER_SETTINGS[name]; + } else { + return (sessionStorage.getItem(name) as Settings[T]) || DEFAULT_USER_SETTINGS[name]; + } } catch { return DEFAULT_USER_SETTINGS[name]; } @@ -125,6 +129,10 @@ export function setSetting(name: string, value: T) { } try { - sessionStorage.setItem(name, String(value)); + if (name === "theme") { + localStorage.setItem(name, String(value)); + } else { + sessionStorage.setItem(name, String(value)); + } } catch {} }