Browse Source

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

JC Brand 8 years ago
parent
commit
d81d62f98d
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/converse-muc.js

+ 2 - 2
src/converse-muc.js

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