mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
rule out double-callbacks when clearing cache
This commit is contained in:
parent
b307b98926
commit
e9033d8b0a
@ -4,7 +4,8 @@ define([
|
||||
'/common/outer/cache-store.js',
|
||||
'/bower_components/localforage/dist/localforage.min.js',
|
||||
'/customize/application_config.js',
|
||||
], function (Constants, Hash, Cache, localForage, AppConfig) {
|
||||
'/common/common-util.js',
|
||||
], function (Constants, Hash, Cache, localForage, AppConfig, Util) {
|
||||
var LocalStore = {};
|
||||
|
||||
LocalStore.setThumbnail = function (key, value, cb) {
|
||||
@ -120,10 +121,10 @@ define([
|
||||
return void AppConfig.customizeLogout(cb);
|
||||
}
|
||||
|
||||
cb = cb || function () {};
|
||||
cb = Util.once(cb || function () {});
|
||||
|
||||
try {
|
||||
Cache.clear(cb); // XXX might call back twice in extreme circumstances?
|
||||
Cache.clear(cb);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
cb();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user