Bug 1777713 - Update pending chat message contents while conversation is not selected. r=darktrojan
authorMartin Giger <martin@humanoids.be>
Mon, 04 Jul 2022 12:35:51 +0200
changeset 36188 927fa9d8e7e5ebfe1f3e96e7f2a7ab77a30deffa
parent 36187 47417ab9d7f76468fe767a7bd47121dc0372a69f
child 36189 40b247165baa05a2bb80f4624d8f9c9ef4878bc3
push id20068
push usernicolai@thunderbird.net
push dateMon, 04 Jul 2022 10:45:08 +0000
treeherdercomm-central@40b247165baa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdarktrojan
bugs1777713
Bug 1777713 - Update pending chat message contents while conversation is not selected. r=darktrojan Differential Revision: https://phabricator.services.mozilla.com/D150866
chat/content/conversation-browser.js
--- a/chat/content/conversation-browser.js
+++ b/chat/content/conversation-browser.js
@@ -426,17 +426,17 @@
      *
      * @param {imIMessage} msg - Message to use as replacement.
      */
     replaceMessage(msg) {
       if (!msg.remoteId) {
         // No remote id, nothing existing to replace.
         return;
       }
-      if (this._messageDisplayPending) {
+      if (this._messageDisplayPending || this._pendingMessages.length) {
         let pendingIndex = this._pendingMessages.findIndex(
           ({ msg: pendingMsg }) => pendingMsg.remoteId === msg.remoteId
         );
         if (
           pendingIndex > -1 &&
           pendingIndex >= this._nextPendingMessageIndex
         ) {
           this._pendingMessages[pendingIndex].msg = msg;