mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
ui: pageloader: remove localstorage
This commit is contained in:
1 parent
fc6e112536
commit
6333c4f9c7
3 files changed
+4
-9
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user