Browse Source

wallpapper config storage fix

master
Sergey-V Markov 2 years ago
parent
commit
52b110f219
  1. 5
      main.js

5
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);

Loading…
Cancel
Save