Skip to content

Commit 83bc851

Browse files
committed
Fixes #1455. Updates #1619
Avatar didn't update a second time due to `canvas` element being expected
1 parent b69440f commit 83bc851

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
- #1296: `embedded` view mode shows `chatbox-navback` arrow in header
3636
- #1330: Missing room name in MUC invitation popup
3737
- #1445: Participants list uses big font in embedded mode
38+
- #1455: Avatar in controlbox status-view not updated
3839
- #1465: When highlighting a roster contact, they're incorrectly shown as online
3940
- #1495: Mentions should always include a URI attribute
4041
- #1502: Fatal error when using prebind

src/converse-chatboxviews.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ const AvatarMixin = {
1919

2020
renderAvatar (el) {
2121
el = el || this.el;
22-
const canvas_el = el.querySelector('canvas');
23-
if (_.isNull(canvas_el)) {
22+
const avatar_el = el.querySelector('canvas.avatar, svg.avatar');
23+
if (_.isNull(avatar_el)) {
2424
return;
2525
}
2626
if (this.model.vcard) {
2727
const data = {
28-
'classes': canvas_el.getAttribute('class'),
29-
'width': canvas_el.width,
30-
'height': canvas_el.height,
28+
'classes': avatar_el.getAttribute('class'),
29+
'width': avatar_el.getAttribute('width'),
30+
'height': avatar_el.getAttribute('height'),
3131
}
3232
const image_type = this.model.vcard.get('image_type'),
3333
image = this.model.vcard.get('image');
3434
data['image'] = "data:" + image_type + ";base64," + image;
35-
canvas_el.outerHTML = tpl_avatar(data);
35+
avatar_el.outerHTML = tpl_avatar(data);
3636
}
3737
},
3838
};

0 commit comments

Comments
 (0)