fix(Avatar): Avatar to return the local avatar when jid is null

This commit is contained in:
hristoterezov 2016-10-12 17:02:50 -05:00
parent 71d767f0b4
commit 84fd0531f6
1 changed files with 9 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* global MD5, config, interfaceConfig */
/* global MD5, config, interfaceConfig, APP */
let users = {};
@ -10,6 +10,12 @@ export default {
* @param val {string} value to be set
*/
_setUserProp: function (id, prop, val) {
// FIXME: Fixes the issue with not be able to return avatar for the
// local user when the conference has been left. Maybe there is beter
// way to solve it.
if(APP.conference.isLocalId(id)) {
id = "local";
}
if(!val || (users[id] && users[id][prop] === val))
return;
if(!users[id])
@ -56,9 +62,8 @@ export default {
return 'images/avatar2.png';
}
if (!userId) {
console.error("Get avatar - id is undefined");
return null;
if (!userId || APP.conference.isLocalId(userId)) {
userId = "local";
}
let avatarId = null;