ui: pageloader: remove localstorage

This commit is contained in:
undefined committed 2022-07-10 11:40:17 +08:00
1 parent fc6e112536
commit 6333c4f9c7
3 files changed
+4 -9

No files matched your search

+2 -7
View File
@@ -32,13 +32,8 @@ document.addEventListener('DOMContentLoaded', async () => {
// eslint-disable-next-line camelcase
try { __webpack_public_path__ = UiContext.cdn_prefix; } catch (e) { }
const local = JSON.parse(localStorage.getItem('hydro-constant') || '{}');
let { data } = local;
if (local.version !== UiContext.constantVersion) {
const res = await fetch(`/constant?version=${UiContext.constantVersion}`);
data = await res.json();
localStorage.setItem('hydro-constant', JSON.stringify({ data, version: UiContext.constantVersion }));
}
const res = await fetch(`/constant/${UiContext.constantVersion}`, { cache: 'force-cache' });
const data = await res.json();
eval(data[0]); // eslint-disable-line no-eval
data.shift();
window.Hydro.preload = data;