From 570a7f5bf8ca88dbf1d5794b950c9fccbf15c331 Mon Sep 17 00:00:00 2001 From: Mikunj Date: Tue, 4 Dec 2018 09:09:15 +1100 Subject: [PATCH] Fix header not updating when editing nickname. --- js/background.js | 1 - js/models/conversations.js | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/js/background.js b/js/background.js index fc0c6d215..ebc613361 100644 --- a/js/background.js +++ b/js/background.js @@ -580,7 +580,6 @@ nickname: displayName, onOk: async (newName) => { await storage.setProfileName(newName); - appView.inboxView.trigger('updateProfile'); // Update the conversation if we have it const conversation = ConversationController.get(ourNumber); diff --git a/js/models/conversations.js b/js/models/conversations.js index b5574d5a1..98ff31c89 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -1621,12 +1621,12 @@ await this.updateProfile(); }, async setProfile(profile) { - if (_.isEqual(this.get('profile'), profile)) return; - - this.set({ profile }); - await window.Signal.Data.updateConversation(this.id, this.attributes, { - Conversation: Whisper.Conversation, - }); + if (!_.isEqual(this.get('profile'), profile)) { + this.set({ profile }); + await window.Signal.Data.updateConversation(this.id, this.attributes, { + Conversation: Whisper.Conversation, + }); + } await this.updateProfile(); },