Fix loading screen colors after switching theme #1144

This commit is contained in:
yflory 2023-07-18 17:31:36 +02:00
parent f27c5f4c93
commit ce6e3ca37f
2 changed files with 8 additions and 0 deletions

View File

@ -13,6 +13,13 @@ define([
};
}
var ls = window.localStorage;
window.CryptPad_flushCacheInner = function () {
Object.keys(ls).forEach(function (k) {
if (k.indexOf('CRYPTPAD_CACHE|') !== 0 && k.indexOf('LESS_CACHE') !== 0) { return; }
delete ls[k];
});
};
var mkFakeStore = function () {
var fakeStorage = {
getItem: function (k) { return fakeStorage[k]; },

View File

@ -471,6 +471,7 @@ define([
// browsers try to load iframes from cache if they have the same id as was previously seen
// this seems to help?
window.location.hash = '';
if (flush && window.CryptPad_flushCacheInner) { window.CryptPad_flushCacheInner(); }
sframeChan.query('Q_COLORTHEME_CHANGE', {
theme: val,
flush: flush