fixes #1304 - Wrong profile picture

This commit is contained in:
Luke 2015-12-24 13:14:12 -05:00
parent 7a6ab8a7da
commit e4fe1517b9

View File

@ -70,6 +70,9 @@
var header = document.querySelector('.viewMenuBar');
var headerUserButton = header.querySelector('.headerUserButton');
var hasImage;
if (user.name) {
if (user.imageUrl && AppInfo.enableUserImage) {
@ -81,15 +84,21 @@
url += "&height=" + (userButtonHeight * Math.max(devicePixelRatio || 1, 2));
}
var headerUserButton = header.querySelector('.headerUserButton');
if (headerUserButton) {
headerUserButton.icon = null;
headerUserButton.src = url;
headerUserButton.classList.add('headerUserButtonRound');
hasImage = true;
}
}
}
if (hasUserButton && !hasImage) {
headerUserButton.icon = 'person';
headerUserButton.src = null;
headerUserButton.classList.remove('headerUserButtonRound');
}
updateLocalUser(user.localUser);
requiresUserRefresh = false;
}