瀏覽代碼

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

JC Brand 8 年之前
父節點
當前提交
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);
                 },