Browse Source

Bugfix. Messages were losing followup class when re-rendered

JC Brand 7 years ago
parent
commit
a33b451b73
1 changed files with 10 additions and 4 deletions
  1. 10 4
      src/converse-message-view.js

+ 10 - 4
src/converse-message-view.js

@@ -81,15 +81,21 @@
                 },
 
                 render () {
+                    const is_followup = u.hasClass('chat-msg-followup', this.el);
+                    let msg;
                     if (this.model.isOnlyChatStateNotification()) {
-                        return this.renderChatStateNotification()
+                        this.renderChatStateNotification()
                     } else if (this.model.get('file') && !this.model.get('oob_url')) {
-                        return this.renderFileUploadProgresBar();
+                        this.renderFileUploadProgresBar();
                     } else if (this.model.get('type') === 'error') {
-                        return this.renderErrorMessage();
+                        this.renderErrorMessage();
                     } else {
-                        return this.renderChatMessage();
+                        this.renderChatMessage();
                     }
+                    if (is_followup) {
+                        u.addClass('chat-msg-followup', this.el);
+                    }
+                    return this.el;
                 },
 
                 replaceElement (msg) {