web,avatar: fix setting avatar size

Use the width of its container as the size, so the font icons can be rendered at
a good size.
This commit is contained in:
Saúl Ibarra Corretgé 2019-08-06 17:02:36 +02:00 committed by Saúl Ibarra Corretgé
parent 149e53af76
commit fd0ca76255
1 changed files with 8 additions and 12 deletions

View File

@ -557,24 +557,19 @@ SmallVideo.prototype._isHovered = function() {
* Hides or shows the user's avatar. * Hides or shows the user's avatar.
* This update assumes that large video had been updated and we will * This update assumes that large video had been updated and we will
* reflect it on this small video. * reflect it on this small video.
*
* @param show whether we should show the avatar or not
* video because there is no dominant speaker and no focused speaker
*/ */
SmallVideo.prototype.updateView = function() { SmallVideo.prototype.updateView = function() {
if (this.disableUpdateView) { if (this.disableUpdateView) {
return; return;
} }
if (!this.hasAvatar) { if (this.id) {
if (this.id) { // Init / refresh avatar
// Init avatar this.initializeAvatar();
this.initializeAvatar(); } else {
} else { logger.error('Unable to init avatar - no id', this);
logger.error('Unable to init avatar - no id', this);
return; return;
}
} }
this.$container.removeClass((index, classNames) => this.$container.removeClass((index, classNames) =>
@ -621,7 +616,8 @@ SmallVideo.prototype.initializeAvatar = function() {
<Provider store = { APP.store }> <Provider store = { APP.store }>
<AvatarDisplay <AvatarDisplay
className = 'userAvatar' className = 'userAvatar'
participantId = { this.id } /> participantId = { this.id }
size = { this.$avatar().width() } />
</Provider>, </Provider>,
thumbnail thumbnail
); );