Fix performance issue for quote rendering

This commit is contained in:
Fedor Indutny 2021-05-21 18:33:54 -07:00 committed by GitHub
parent bbd611b189
commit d605daa04f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3620,9 +3620,6 @@ Whisper.ConversationView = Whisper.View.extend({
const props = message.getPropsForQuote();
const contact = this.quotedMessage.getContact();
if (contact) {
this.listenTo(contact, 'change', this.renderQuotedMesage);
}
this.quoteView = new Whisper.ReactWrapperView({
className: 'quote-wrapper',
@ -3640,6 +3637,12 @@ Whisper.ConversationView = Whisper.View.extend({
},
},
});
if (contact) {
this.quoteView.listenTo(contact, 'change', () => {
this.renderQuotedMessage();
});
}
},
showInvalidMessageToast(messageText?: string): boolean {