Explorar o código

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

JC Brand %!s(int64=8) %!d(string=hai) anos
pai
achega
9f28728e61
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  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);
                 },