|
@@ -433,12 +433,18 @@ function finishInitialization () {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+function unregisterGlobalEventHandlers () {
|
|
|
|
+ document.removeEventListener("visibilitychange", _converse.saveWindowState);
|
|
|
|
+ _converse.emit('registeredGlobalEventHandlers');
|
|
|
|
+}
|
|
|
|
+
|
|
function cleanup () {
|
|
function cleanup () {
|
|
// Looks like _converse.initialized was called again without logging
|
|
// Looks like _converse.initialized was called again without logging
|
|
// out or disconnecting in the previous session.
|
|
// out or disconnecting in the previous session.
|
|
// This happens in tests. We therefore first clean up.
|
|
// This happens in tests. We therefore first clean up.
|
|
Backbone.history.stop();
|
|
Backbone.history.stop();
|
|
_converse.chatboxviews.closeAllChatBoxes();
|
|
_converse.chatboxviews.closeAllChatBoxes();
|
|
|
|
+ unregisterGlobalEventHandlers();
|
|
window.localStorage.clear();
|
|
window.localStorage.clear();
|
|
window.sessionStorage.clear();
|
|
window.sessionStorage.clear();
|
|
if (_converse.bookmarks) {
|
|
if (_converse.bookmarks) {
|