From 00fda0d7d7c8ee1a79d2bc078da0f32f95734616 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 28 Aug 2017 16:49:28 +0200 Subject: [PATCH] Fix avatar in read-only mode (secure pads) --- www/common/sframe-common-interface.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/www/common/sframe-common-interface.js b/www/common/sframe-common-interface.js index 8f418bc46..24b03bdae 100644 --- a/www/common/sframe-common-interface.js +++ b/www/common/sframe-common-interface.js @@ -43,7 +43,6 @@ define([ $container.append($avatar); if (cb) { cb(); } }; - if (!href) { return void displayDefault(); } var parsed = Cryptpad.parsePadUrl(href); var secret = Cryptpad.getSecrets('file', parsed.hash); @@ -210,19 +209,17 @@ define([ var $avatar = $userAdmin.find('.buttonTitle'); var updateButton = function () { - var myData = metadataMgr.getMetadata().users[metadataMgr.getNetfluxId()]; + var myData = metadataMgr.getUserData(); if (!myData) { return; } var newName = myData.name; var url = myData.avatar; $displayName.text(newName || Messages.anonymous); - if (accountName) { - $avatar.html(''); - UI.displayAvatar(Common, $avatar, url, newName, function ($img) { - if ($img) { - $userAdmin.find('button').addClass('avatar'); - } - }); - } + $avatar.html(''); + UI.displayAvatar(Common, $avatar, url, newName, function ($img) { + if ($img) { + $userAdmin.find('button').addClass('avatar'); + } + }); }; metadataMgr.onChange(updateButton); updateButton();