Clear throttled functions in cache

pull/1/head
yflory 4 years ago
parent b3f91dd9a2
commit 51ebdf4ed2

@ -2277,6 +2277,9 @@ define([
try { try {
store.onlyoffice.leavePad(chanId); store.onlyoffice.leavePad(chanId);
} catch (e) { console.error(e); } } catch (e) { console.error(e); }
try {
Cache.leaveChannel(chanId);
} catch (e) { console.error(e); }
if (!Store.channels[chanId]) { return; } if (!Store.channels[chanId]) { return; }

@ -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) { S.clearChannel = function (id, cb) {
cb = Util.once(Util.mkAsync(cb || function () {})); cb = Util.once(Util.mkAsync(cb || function () {}));

Loading…
Cancel
Save