From 2a499376499992fe517ceaf7734894ea40ff0415 Mon Sep 17 00:00:00 2001 From: Andrew <92226824+turbokirichenko@users.noreply.github.com> Date: Sat, 14 Dec 2024 20:24:52 +0200 Subject: [PATCH] Saved Theme Preference Using LocalStorage Instead of SessionStorage Saved Theme Preference Using LocalStorage Instead of SessionStorage #92 --- src/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 32e8e6d..c9a8b63 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -113,7 +113,7 @@ function getSetting(name: T): Settings[T] { } try { - return (sessionStorage.getItem(name) as Settings[T]) || DEFAULT_USER_SETTINGS[name]; + return (localStorage.getItem(name) as Settings[T]) || DEFAULT_USER_SETTINGS[name]; } catch { return DEFAULT_USER_SETTINGS[name]; } @@ -125,6 +125,6 @@ export function setSetting(name: string, value: T) { } try { - sessionStorage.setItem(name, String(value)); + localStorage.setItem(name, String(value)); } catch {} }