Commit 4c964c56 authored by JC Brand's avatar JC Brand

Filter out undefined

parent 60bb3139
...@@ -68771,9 +68771,10 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins ...@@ -68771,9 +68771,10 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins
_converse.api.listen.on('afterTearDown', () => { _converse.api.listen.on('afterTearDown', () => {
if (_converse.presences) { if (_converse.presences) {
_converse.presences.each(p => { _converse.presences.each(p => {
p.resources.each(r => r.destroy({ _.each(p.resources.reject(_.isUndefined), r => r.destroy({
'silent': true 'silent': true
})); }));
p.save({ p.save({
'show': 'offline' 'show': 'offline'
}, { }, {
...@@ -836,7 +836,7 @@ converse.plugins.add('converse-roster', { ...@@ -836,7 +836,7 @@ converse.plugins.add('converse-roster', {
_converse.api.listen.on('afterTearDown', () => { _converse.api.listen.on('afterTearDown', () => {
if (_converse.presences) { if (_converse.presences) {
_converse.presences.each(p => { _converse.presences.each(p => {
p.resources.each(r => r.destroy({'silent': true})); _.each(p.resources.reject(_.isUndefined), r => r.destroy({'silent': true}));
p.save({'show': 'offline'}, {'silent': true}) p.save({'show': 'offline'}, {'silent': true})
}); });
} }
......
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