mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
MessageView: Handle change of color to null, call getColor() (#1438)
When we relied on the actual value of the color property to be supplied to the updateColor change event listener, sometimes it would be null. Then the conversation bubbles would have no color at all, making the text hard to read. FREEBIE
This commit is contained in:
parent
4cba16cb61
commit
4009a0119e
1 changed files with 6 additions and 3 deletions
|
@ -365,15 +365,18 @@
|
|||
|
||||
return this;
|
||||
},
|
||||
updateColor: function(model, color) {
|
||||
updateColor: function() {
|
||||
var bubble = this.$('.bubble');
|
||||
bubble.removeClass(Whisper.Conversation.COLORS);
|
||||
|
||||
// this.contact is known to be non-null if we're registered for color changes
|
||||
var color = this.contact.getColor();
|
||||
if (color) {
|
||||
bubble.removeClass(Whisper.Conversation.COLORS);
|
||||
bubble.addClass(color);
|
||||
}
|
||||
this.avatarView = new (Whisper.View.extend({
|
||||
templateName: 'avatar',
|
||||
render_attributes: { avatar: model.getAvatar() }
|
||||
render_attributes: { avatar: this.model.getAvatar() }
|
||||
}))();
|
||||
this.$('.avatar').replaceWith(this.avatarView.render().$('.avatar'));
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue