diff --git a/main.js b/main.js index 92ae039..6b1c457 100755 --- a/main.js +++ b/main.js @@ -45,6 +45,16 @@ function updateDefaults(user, session) { } } +function updateDefaultsInLocalstorage() { + var user = document.getElementById("user").textContent + var session = document.getElementById("sessions").value + if (!user || !session) { + return false; + } + + updateDefaults(user, session); +} + function dateFormat(date) { var parts=date.split('.'); var options = { weekday: 'long', month: 'long', day: 'numeric' }; @@ -75,8 +85,6 @@ function doLogin() { lightdm.cancel_authentication(); - updateDefaults(user, session); - toggleWaitingState(true); lightdm.authenticate(user) return false; @@ -96,11 +104,15 @@ function updateUser(username) { } } }); + + updateDefaultsInLocalstorage(); } function updateWallpapper(wallpapper) { var body = document.getElementsByTagName('body')[0]; body.style.backgroundImage = `url(wallpappers/${wallpapper})`; + + updateDefaultsInLocalstorage(); } function initGreeter() { @@ -147,6 +159,10 @@ function initGreeter() { } sessionsSelect.value = defaultSession; + sessionsSelect.addEventListener('change', (event) => { + updateDefaultsInLocalstorage(); + }); + document.getElementById("date").textContent=dateFormat(theme_utils.get_current_localized_date()); document.getElementById("time").textContent=theme_utils.get_current_localized_time(); diff --git a/web-greeter-theme-basealt.spec b/web-greeter-theme-basealt.spec index c16d97e..4ad3ce6 100644 --- a/web-greeter-theme-basealt.spec +++ b/web-greeter-theme-basealt.spec @@ -1,7 +1,7 @@ %define shortname basealt Name: web-greeter-theme-basealt -Version: 1.0.3 +Version: 1.0.4 Release: alt1 Summary: A theme for web-greeter on AltLinux @@ -34,6 +34,9 @@ rsync -rv --exclude-from=./.copyignore ./* %buildroot%_datadir/web-greeter/theme %_datadir/web-greeter/themes/%shortname/* %changelog +* Sun Jan 8 2023 Sergey-V Markov 1.0.4-alt1 +- Bug fix with defaults updating storage + * Tue Oct 25 2022 Sergey-V Markov 1.0.3-alt1 - New feature to wait authentication