Clear cache on logout

pull/1/head
yflory 4 years ago
parent 58cdf21def
commit 7756306966

@ -82,8 +82,9 @@ define([
}); });
}; };
S.clear = function () { S.clear = function (cb) {
cache.clear(); cb = Util.once(Util.mkAsync(cb || function () {}));
cache.clear(cb);
}; };
return S; return S;

@ -1,9 +1,10 @@
define([ define([
'/common/common-constants.js', '/common/common-constants.js',
'/common/common-hash.js', '/common/common-hash.js',
'/common/outer/cache-store.js',
'/bower_components/localforage/dist/localforage.min.js', '/bower_components/localforage/dist/localforage.min.js',
'/customize/application_config.js', '/customize/application_config.js',
], function (Constants, Hash, localForage, AppConfig) { ], function (Constants, Hash, Cache, localForage, AppConfig) {
var LocalStore = {}; var LocalStore = {};
LocalStore.setThumbnail = function (key, value, cb) { LocalStore.setThumbnail = function (key, value, cb) {
@ -119,7 +120,14 @@ define([
return void AppConfig.customizeLogout(cb); return void AppConfig.customizeLogout(cb);
} }
if (cb) { cb(); } cb = cb || function () {};
try {
Cache.clear(cb);
} catch (e) {
console.error(e);
cb();
}
}; };
var loginHandlers = []; var loginHandlers = [];
LocalStore.loginReload = function () { LocalStore.loginReload = function () {

Loading…
Cancel
Save