Fix profile corrupted cache

pull/1/head
yflory 4 years ago
parent 59ca7ac4d2
commit e41e6c39ce

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

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

Loading…
Cancel
Save