Commit 7803fd23 authored by JC Brand's avatar JC Brand

Clear chat boxes when clearing cache

parent 19dc6690
......@@ -3225,8 +3225,8 @@
}
},
"@converse/skeletor": {
"version": "github:conversejs/skeletor#0f819a4f3ea013b3a48c3fcb600c3138559e1c0d",
"from": "github:conversejs/skeletor#0f819a4f3ea013b3a48c3fcb600c3138559e1c0d",
"version": "github:conversejs/skeletor#56a284bd36a07977d69c08d78e7c8c0fc9fc5c87",
"from": "github:conversejs/skeletor#56a284bd36a07977d69c08d78e7c8c0fc9fc5c87",
"requires": {
"lit-html": "^1.2.1",
"lodash-es": "^4.17.15"
......
......@@ -1315,9 +1315,11 @@ converse.plugins.add('converse-chat', {
api.listen.on('chatBoxesFetched', autoJoinChats);
api.listen.on('presencesInitialized', registerMessageHandlers);
api.listen.on('clearSession', () => {
api.listen.on('clearSession', async () => {
if (_converse.shouldClearCache()) {
return Promise.all(_converse.chatboxes.map(c => c.messages && c.messages.clearStore({'silent': true})));
await Promise.all(_converse.chatboxes.map(c => c.messages && c.messages.clearStore({'silent': true})));
const filter = (o) => (o.get('type') !== _converse.CONTROLBOX_TYPE);
_converse.chatboxes.clearStore({'silent': true}, filter);
}
});
/************************ END Event Handlers ************************/
......
......@@ -36,7 +36,7 @@
},
"gitHead": "9641dcdc820e029b05930479c242d2b707bbe8e2",
"devDependencies": {
"@converse/skeletor": "conversejs/skeletor#0f819a4f3ea013b3a48c3fcb600c3138559e1c0d",
"@converse/skeletor": "conversejs/skeletor#56a284bd36a07977d69c08d78e7c8c0fc9fc5c87",
"filesize": "^6.1.0",
"localforage": "^1.9.0",
"lodash-es": "^4.17.15",
......
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