浏览代码

muc: check for `browserStorage` attr instead of whether connected

JC Brand 8 年之前
父节点
当前提交
d81d62f98d
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/converse-muc.js

+ 2 - 2
src/converse-muc.js

@@ -470,7 +470,7 @@
                      *
                      * This is instead done in `afterConnected` below.
                      */
-                    if (_converse.connection.connected) {
+                    if (this.model.collection.browserStorage) {
                         // Without a connection, we haven't yet initialized
                         // localstorage
                         this.model.save();
@@ -1150,7 +1150,7 @@
                 },
 
                 cleanup: function () {
-                    if (_converse.connection.connected) {
+                    if (this.model.collection.browserStorage) {
                         this.model.save('connection_status', ROOMSTATUS.DISCONNECTED);
                     } else {
                         this.model.set('connection_status', ROOMSTATUS.DISCONNECTED);