diff --git a/www/common/outer/local-store.js b/www/common/outer/local-store.js index c6d937e94..95a3bd88b 100644 --- a/www/common/outer/local-store.js +++ b/www/common/outer/local-store.js @@ -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();