Commit b7c9c0f5 authored by JC Brand's avatar JC Brand

Only save the session if it's valid.

parent 45875afd
......@@ -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));
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment