Fix profile corrupted cache

This commit is contained in:
yflory 2021-01-28 13:58:43 +01:00
parent 59ca7ac4d2
commit e41e6c39ce
2 changed files with 14 additions and 0 deletions

View File

@ -657,8 +657,16 @@ define([
var lm = APP.lm = Listmap.create(listmapConfig);
var onCorruptedCache = function () {
var sframeChan = common.getSframeChannel();
sframeChan.event("EV_PROFILE_CORRUPTED_CACHE");
};
init();
lm.proxy.on('ready', function () {
if (JSON.stringify(lm.proxy) === '{}') {
return void onCorruptedCache();
}
updateValues(lm.proxy);
UI.removeLoadingScreen();
common.mailbox.subscribe(["notifications"], {

View File

@ -70,6 +70,12 @@ define([
Cryptpad.setAvatar(undefined, cb);
});
});
sframeChan.on('EV_PROFILE_CORRUPTED_CACHE', function () {
Utils.Cache.clearChannel(Utils.secret.channel, function () {
window.location.reload();
});
});
};
SFCommonO.start({
getSecrets: getSecrets,