From 52b110f2199cbecd5a1e2a6ef2db6eeb42116f01 Mon Sep 17 00:00:00 2001 From: Sergey-V Markov Date: Sat, 22 Oct 2022 14:50:36 +0300 Subject: [PATCH] wallpapper config storage fix --- main.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index d3ad749..2b7d4fb 100755 --- a/main.js +++ b/main.js @@ -1,6 +1,7 @@ const DEFAULT_USER = "defaultUser"; const DEFAULT_SESSION = "defaultSession"; const DEFAULT_WALLPAPPER = "defaultWallpapper"; +const WALLPAPPER_ELEMENT = "wallpappers"; function togglePasswordVisibility() { var passwd = document.getElementById("password"); @@ -19,7 +20,7 @@ function updateDefaults(user, session) { localStorage.setItem(DEFAULT_USER, user) localStorage.setItem(DEFAULT_SESSION, session) - var wallpapper = document.getElementById("wallpappers").value + var wallpapper = document.getElementById(WALLPAPPER_ELEMENT).value if(wallpapper) { localStorage.setItem(DEFAULT_WALLPAPPER, wallpapper) } @@ -106,7 +107,7 @@ function initGreeter() { select.appendChild(btn) } - const wallpappers = document.getElementById('wallpappers'); + const wallpappers = document.getElementById(WALLPAPPER_ELEMENT); wallpappers.addEventListener('change', (event) => { updateWallpapper(event.target.value);