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) {