From e8298f165ab9c5681b23346c11088bf9f085e4ae Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 7 Sep 2017 16:35:24 +0200 Subject: [PATCH] only display first letter of name if user has no avatar --- www/common/cryptpad-common.js | 4 ++-- www/common/sframe-common-interface.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 502a1878d..40dbee37a 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -1967,7 +1967,7 @@ define([ }; var $userAdmin = createDropdown(dropdownConfigUser); - var oldUrl; + var oldUrl = ''; if (account && !config.static && store) { var $avatar = $userAdmin.find('.cp-dropdown-button-title'); var updateButton = function (newName) { @@ -1977,7 +1977,7 @@ define([ if (oldUrl === url) { return; } oldUrl = url; $avatar.html(''); - common.displayAvatar($avatar, url, newName, function ($img) { + common.displayAvatar($avatar, url, newName || Messages.anonymous, function ($img) { if ($img) { $userAdmin.find('button').addClass('avatar'); } diff --git a/www/common/sframe-common-interface.js b/www/common/sframe-common-interface.js index 69060b3b1..0b38de654 100644 --- a/www/common/sframe-common-interface.js +++ b/www/common/sframe-common-interface.js @@ -374,7 +374,7 @@ define([ var $displayName = $userAdmin.find('.'+displayNameCls); var $avatar = $userAdmin.find('.cp-dropdown-button-title'); - var oldUrl; + var oldUrl = ''; var updateButton = function () { var myData = metadataMgr.getUserData(); if (!myData) { return; } @@ -383,7 +383,7 @@ define([ $displayName.text(newName || Messages.anonymous); if (accountName && oldUrl !== url) { $avatar.html(''); - UI.displayAvatar(Common, $avatar, url, newName, function ($img) { + UI.displayAvatar(Common, $avatar, url, newName || Messages.anonymous, function ($img) { oldUrl = url; if ($img) { $userAdmin.find('button').addClass('cp-avatar');