diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index afb799990..da7abf9d0 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -2277,6 +2277,9 @@ define([ try { store.onlyoffice.leavePad(chanId); } catch (e) { console.error(e); } + try { + Cache.leaveChannel(chanId); + } catch (e) { console.error(e); } if (!Store.channels[chanId]) { return; } diff --git a/www/common/outer/cache-store.js b/www/common/outer/cache-store.js index ad9f1e04f..4b21e22fe 100644 --- a/www/common/outer/cache-store.js +++ b/www/common/outer/cache-store.js @@ -117,6 +117,13 @@ define([ }); }; + S.leaveChannel = function (id) { + if (t[id] && typeof(t[id].clear) === "function") { + t[id].clear(); + } + delete t[id]; + }; + S.clearChannel = function (id, cb) { cb = Util.once(Util.mkAsync(cb || function () {}));