2
0
Эх сурвалжийг харах

Catch errors when `destroy` is called for already removed message

JC Brand 6 жил өмнө
parent
commit
3085c5d408

+ 7 - 1
src/headless/converse-chatboxes.js

@@ -87,7 +87,13 @@ converse.plugins.add('converse-chatboxes', {
                     this.on('change:put', this.uploadFile, this);
                     this.on('change:put', this.uploadFile, this);
                 }
                 }
                 if (this.isOnlyChatStateNotification()) {
                 if (this.isOnlyChatStateNotification()) {
-                    window.setTimeout(this.destroy.bind(this), 20000);
+                    window.setTimeout(() => {
+                        try {
+                            this.destroy()
+                        } catch (e) {
+                            _converse.log(e, Strophe.LogLevel.ERROR);
+                        }
+                    }, 20000);
                 }
                 }
             },
             },