Browse Source

fix empty session list (for real this time)

sisyphus
Dustin Falgout 9 years ago
parent
commit
d92202f0ce
  1. 17
      themes/antergos/js/greeter.js

17
themes/antergos/js/greeter.js

@ -47,21 +47,24 @@ $(document).ready(function() {
function buildUserList() { function buildUserList() {
// User list building // User list building
userList = $('#user-list2'); userList = $('#user-list2');
for (var i in lightdm.users) { for ( var i = 0; i < lightdm.users.length; i++ ) {
var user = lightdm.users[i]; var user = lightdm.users[i],
var tux = 'img/antergos-logo-user.png'; tux = 'img/antergos-logo-user.png',
var imageSrc = user.image.length > 0 ? user.image : tux; lastSession = localStorage.getItem(user.name ),
var lastSession = localStorage.getItem(user.name); imageSrc = user.image.length ? user.image : tux;
if (lastSession == null && lastSession == undefined) {
if (null === lastSession) {
localStorage.setItem(user.name, lightdm.default_session); localStorage.setItem(user.name, lightdm.default_session);
lastSession = localStorage.getItem(user.name); lastSession = lightdm.default_session;
} }
log('Last Session (' + user.name + '): ' + lastSession); log('Last Session (' + user.name + '): ' + lastSession);
var li = '<a href="#' + user.name + '" class="list-group-item ' + user.name + '" onclick="startAuthentication(\'' + user.name + '\')" data-session="' + lastSession + '">' + var li = '<a href="#' + user.name + '" class="list-group-item ' + user.name + '" onclick="startAuthentication(\'' + user.name + '\')" data-session="' + lastSession + '">' +
'<img src="' + imageSrc + '" class="img-circle" alt="' + user.display_name + '" onerror="imgNotFound(this)"/> ' + '<img src="' + imageSrc + '" class="img-circle" alt="' + user.display_name + '" onerror="imgNotFound(this)"/> ' +
'<span>' + user.display_name + '</span>' + '<span>' + user.display_name + '</span>' +
'<span class="badge"><i class="fa fa-check"></i></span>' + '<span class="badge"><i class="fa fa-check"></i></span>' +
'</a>'; '</a>';
$(userList).append(li); $(userList).append(li);
} }
if ($(userList).children().length > 3) { if ($(userList).children().length > 3) {

Loading…
Cancel
Save