From ea8e76d9de6ddb5566f440a6768ed2b2d785de9e Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Fri, 31 Aug 2018 13:39:56 -0700 Subject: [PATCH] MessageView: Only re-render on change of key conversation fields --- js/views/message_view.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/js/views/message_view.js b/js/views/message_view.js index 11fd2efbd3..b260b9ba17 100644 --- a/js/views/message_view.js +++ b/js/views/message_view.js @@ -99,17 +99,24 @@ this.listenTo(this.model, 'change', update); this.listenTo(this.model, 'expired', update); + const applicableConversationChanges = + 'change:color change:name change:number change:profileName change:profileAvatar'; + this.conversation = this.model.getConversation(); - this.listenTo(this.conversation, 'change', update); + this.listenTo(this.conversation, applicableConversationChanges, update); this.fromContact = this.model.getIncomingContact(); if (this.fromContact) { - this.listenTo(this.fromContact, 'change', update); + this.listenTo(this.fromContact, applicableConversationChanges, update); } this.quotedContact = this.model.getQuoteContact(); if (this.quotedContact) { - this.listenTo(this.quotedContact, 'change', update); + this.listenTo( + this.quotedContact, + applicableConversationChanges, + update + ); } this.$el.append(this.childView.el);