From e7aa1aee001c57d28710c46ffa613c17bea8b8d6 Mon Sep 17 00:00:00 2001 From: novcmbro Date: Thu, 6 Jun 2024 18:10:35 -0300 Subject: [PATCH] changed theme.db to theme.name --- index.html | 2 +- src/js/theme.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index f6f18c8..9adaea8 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ - + diff --git a/src/js/theme.js b/src/js/theme.js index ddc8398..cb079c1 100644 --- a/src/js/theme.js +++ b/src/js/theme.js @@ -3,8 +3,8 @@ const localStorageKey = "novcmbro_decoder_theme" const rootElement = document.documentElement const theme = { + name: () => localStorage.getItem(localStorageKey), preferred: undefined, - db: () => localStorage.getItem(localStorageKey), update: undefined, init: undefined, change: undefined @@ -12,10 +12,10 @@ const theme = { theme.preferred = () => prefersLightTheme.matches ? "light" : "dark" -theme.update = () => rootElement.className = theme.db() +theme.update = () => rootElement.className = theme.name() theme.init = () => { - if (!theme.db()) { + if (!theme.name()) { localStorage.setItem(localStorageKey, theme.preferred()) }