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

Only save the session if it's valid.

JC Brand 10 жил өмнө
parent
commit
b7c9c0f508
1 өөрчлөгдсөн 5 нэмэгдсэн , 1 устгасан
  1. 5 1
      converse.js

+ 5 - 1
converse.js

@@ -541,7 +541,11 @@
             this.session.browserStorage = new Backbone.BrowserStorage[converse.storage](id);
             this.session.fetch();
             $(window).on('beforeunload', $.proxy(function () {
-                this.setSession();
+                if (converse.connection.connected) {
+                    this.setSession();
+                } else {
+                    this.session.browserStorage._clear();
+                }
             }, this));
         };