diff options
Diffstat (limited to 'assets/js')
-rw-r--r-- | assets/js/settings.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/assets/js/settings.js b/assets/js/settings.js index 5712039..b53d2ce 100644 --- a/assets/js/settings.js +++ b/assets/js/settings.js @@ -25,12 +25,18 @@ document.addEventListener("DOMContentLoaded", async () => { }); localforage.getItem("chosenLang").then((value) => { - let selectedLanguage = value ?? "sl"; + let selectedLanguage = value; + if(value == null || value.length < 1) { + selectedLanguage = "sl"; + } $(`#option-${selectedLanguage}`).attr("selected", true); }).catch(() => {}); localforage.getItem("theme").then((value) => { - let selectedTheme = value ?? "themeLight"; + let selectedTheme = value; + if(value == null || value.length < 1) { + selectedTheme = "themeLight"; + } $(`#option-${selectedTheme}`).attr("selected", true); }).catch(() => {}); |