From d92202f0ce795c115a798974749f81946d65372c Mon Sep 17 00:00:00 2001 From: Dustin Falgout Date: Thu, 31 Dec 2015 20:20:51 -0600 Subject: [PATCH] fix empty session list (for real this time) --- themes/antergos/js/greeter.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/themes/antergos/js/greeter.js b/themes/antergos/js/greeter.js index 1c3f9dd..5172df0 100644 --- a/themes/antergos/js/greeter.js +++ b/themes/antergos/js/greeter.js @@ -47,21 +47,24 @@ $(document).ready(function() { function buildUserList() { // User list building userList = $('#user-list2'); - for (var i in lightdm.users) { - var user = lightdm.users[i]; - var tux = 'img/antergos-logo-user.png'; - var imageSrc = user.image.length > 0 ? user.image : tux; - var lastSession = localStorage.getItem(user.name); - if (lastSession == null && lastSession == undefined) { + for ( var i = 0; i < lightdm.users.length; i++ ) { + var user = lightdm.users[i], + tux = 'img/antergos-logo-user.png', + lastSession = localStorage.getItem(user.name ), + imageSrc = user.image.length ? user.image : tux; + + if (null === lastSession) { localStorage.setItem(user.name, lightdm.default_session); - lastSession = localStorage.getItem(user.name); + lastSession = lightdm.default_session; } log('Last Session (' + user.name + '): ' + lastSession); + var li = '' + '' + user.display_name + ' ' + '' + user.display_name + '' + '' + ''; + $(userList).append(li); } if ($(userList).children().length > 3) {