Commit d5e89655 authored by JC Brand's avatar JC Brand

Still check the view mode since the trimChats method is debounced

parent a389f52a
...@@ -53177,6 +53177,10 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_1__["default"].plugins ...@@ -53177,6 +53177,10 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_1__["default"].plugins
}).catch(_.partial(_converse.log, _, Strophe.LogLevel.FATAL)); }).catch(_.partial(_converse.log, _, Strophe.LogLevel.FATAL));
const debouncedTrim = _.debounce(ev => { const debouncedTrim = _.debounce(ev => {
if (_converse.view_mode !== 'overlayed') {
return;
}
if (_converse.connection.connected) { if (_converse.connection.connected) {
_converse.chatboxviews.trimChats(); _converse.chatboxviews.trimChats();
} }
...@@ -63451,11 +63455,12 @@ _converse.initialize = function (settings, callback) { ...@@ -63451,11 +63455,12 @@ _converse.initialize = function (settings, callback) {
}; };
this.registerGlobalEventHandlers = function () { this.registerGlobalEventHandlers = function () {
document.addEventListener("visibilitychange", _converse.saveWindowState); // set the initial state document.addEventListener("visibilitychange", _converse.saveWindowState);
_converse.saveWindowState({ _converse.saveWindowState({
'type': document.hidden ? "blur" : "focus" 'type': document.hidden ? "blur" : "focus"
}); }); // Set initial state
_converse.emit('registeredGlobalEventHandlers'); _converse.emit('registeredGlobalEventHandlers');
}; };
...@@ -518,6 +518,9 @@ converse.plugins.add('converse-minimize', { ...@@ -518,6 +518,9 @@ converse.plugins.add('converse-minimize', {
const debouncedTrim = _.debounce(ev => { const debouncedTrim = _.debounce(ev => {
if (_converse.view_mode !== 'overlayed') {
return;
}
if (_converse.connection.connected) { if (_converse.connection.connected) {
_converse.chatboxviews.trimChats(); _converse.chatboxviews.trimChats();
} }
......
...@@ -851,9 +851,7 @@ _converse.initialize = function (settings, callback) { ...@@ -851,9 +851,7 @@ _converse.initialize = function (settings, callback) {
this.registerGlobalEventHandlers = function () { this.registerGlobalEventHandlers = function () {
document.addEventListener("visibilitychange", _converse.saveWindowState); document.addEventListener("visibilitychange", _converse.saveWindowState);
_converse.saveWindowState({'type': document.hidden ? "blur" : "focus"}); // Set initial state
// set the initial state
_converse.saveWindowState({'type': document.hidden ? "blur" : "focus"});
_converse.emit('registeredGlobalEventHandlers'); _converse.emit('registeredGlobalEventHandlers');
}; };
......
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