Don't send request for avatar unless they are enabled
While the avatar img tag was itself hidden correctly, a request was still being made to fetch it when a message was stamped causig noise in the console. This fixes that. Change-Id: I94aac49bf5de21538ef277c79903cbff88e96998
This commit is contained in:
parent
14b63d569b
commit
e4cc4a944f
@ -116,7 +116,7 @@ limitations under the License.
|
||||
}
|
||||
</style>
|
||||
<div class$="[[_computeClass(expanded, showAvatar)]]">
|
||||
<img class="avatar" src$="[[_computeAvatarURL(message.author)]]">
|
||||
<img class="avatar" src$="[[_computeAvatarURL(message.author, showAvatar)]]">
|
||||
<div class="contentContainer">
|
||||
<div class="name" id="name">[[message.author.name]]</div>
|
||||
<div class="content">
|
||||
@ -223,8 +223,8 @@ limitations under the License.
|
||||
return classes.join(' ');
|
||||
},
|
||||
|
||||
_computeAvatarURL: function(author) {
|
||||
if (!author) { return '' }
|
||||
_computeAvatarURL: function(author, showAvatar) {
|
||||
if (!showAvatar || !author) { return '' }
|
||||
return '/accounts/' + author.email + '/avatar?s=100';
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user