Fix avatar issues

pull/1/head
yflory 5 years ago
parent bb23b1249e
commit 835f531c9e

@ -2826,13 +2826,13 @@ define([
}; };
UIElements.displayAvatar = function (common, $container, href, name, cb) { UIElements.displayAvatar = function (common, $container, href, name, cb) {
var displayDefault = function () { var displayDefault = function () {
var text = typeof(href) === "string" ? href : getFirstEmojiOrCharacter(name); var text = (href && typeof(href) === "string") ? href : getFirstEmojiOrCharacter(name);
var $avatar = $('<span>', {'class': 'cp-avatar-default'}).text(text); var $avatar = $('<span>', {'class': 'cp-avatar-default'}).text(text);
$container.append($avatar); $container.append($avatar);
if (cb) { cb(); } if (cb) { cb(); }
}; };
if (!window.Symbol) { return void displayDefault(); } // IE doesn't have Symbol if (!window.Symbol) { return void displayDefault(); } // IE doesn't have Symbol
if (typeof(href) !== "string" || href.length === 1) { return void displayDefault(); } if (!href || href.length === 1) { return void displayDefault(); }
var centerImage = function ($img, $image, img) { var centerImage = function ($img, $image, img) {
var w = img.width; var w = img.width;

Loading…
Cancel
Save