Add unregisterGlobalEventHandlers method
And call it when `converse.initialize` gets called again
This commit is contained in:
parent
003af0c438
commit
9ff505fd66
7
dist/converse.js
vendored
7
dist/converse.js
vendored
@ -62948,6 +62948,12 @@ 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.
|
||||||
@ -62956,6 +62962,7 @@ function cleanup() {
|
|||||||
|
|
||||||
_converse.chatboxviews.closeAllChatBoxes();
|
_converse.chatboxviews.closeAllChatBoxes();
|
||||||
|
|
||||||
|
unregisterGlobalEventHandlers();
|
||||||
window.localStorage.clear();
|
window.localStorage.clear();
|
||||||
window.sessionStorage.clear();
|
window.sessionStorage.clear();
|
||||||
|
|
||||||
|
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user