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

Updates #849. Don't call when no connection present

JC Brand 8 жил өмнө
parent
commit
9f28728e61
1 өөрчлөгдсөн 5 нэмэгдсэн , 1 устгасан
  1. 5 1
      src/converse-muc.js

+ 5 - 1
src/converse-muc.js

@@ -1146,7 +1146,11 @@
                 },
 
                 cleanup: function () {
-                    this.model.save('connection_status', ROOMSTATUS.DISCONNECTED);
+                    if (_converse.connection.connected) {
+                        this.model.save('connection_status', ROOMSTATUS.DISCONNECTED);
+                    } else {
+                        this.model.set('connection_status', ROOMSTATUS.DISCONNECTED);
+                    }
                     this.removeHandlers();
                     _converse.ChatBoxView.prototype.close.apply(this, arguments);
                 },