Only save the session if it's valid.
This commit is contained in:
parent
45875afd64
commit
b7c9c0f508
@ -541,7 +541,11 @@
|
|||||||
this.session.browserStorage = new Backbone.BrowserStorage[converse.storage](id);
|
this.session.browserStorage = new Backbone.BrowserStorage[converse.storage](id);
|
||||||
this.session.fetch();
|
this.session.fetch();
|
||||||
$(window).on('beforeunload', $.proxy(function () {
|
$(window).on('beforeunload', $.proxy(function () {
|
||||||
this.setSession();
|
if (converse.connection.connected) {
|
||||||
|
this.setSession();
|
||||||
|
} else {
|
||||||
|
this.session.browserStorage._clear();
|
||||||
|
}
|
||||||
}, this));
|
}, this));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user