mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01: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;
|
||||
|
||||
@@ -200,7 +200,7 @@ global.Hydro.handler.ui = async () => {
|
||||
Route('wiki_help', '/wiki/help', WikiHelpHandler);
|
||||
Route('wiki_about', '/wiki/about', WikiAboutHandler);
|
||||
Route('set_theme', '/set_theme/:theme', SetThemeHandler);
|
||||
Route('constant', '/constant', UiConstantsHandler);
|
||||
Route('constant', '/constant/:version', UiConstantsHandler);
|
||||
Route('markdown', '/markdown', MarkdownHandler);
|
||||
Route('lang', '/l/:lang', LanguageHandler);
|
||||
Route('media', '/media', RichMediaHandler);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/ui-default",
|
||||
"version": "4.38.7",
|
||||
"version": "4.38.8",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"license": "AGPL-3.0",
|
||||
"main": "hydro.js",
|
||||
|
||||
Reference in new issue
Block a user