core: performance enhancement

This commit is contained in:
undefined committed 2022-07-31 23:44:22 +08:00
1 parent bab15a775b
commit f22caf8c7b
6 files changed
+15 -9

No files matched your search

+5 -5
View File
@@ -36,7 +36,7 @@ declare module 'hydrooj/src/service/layers/base' {
let constant = '';
let hash = '';
async function run() {
async function buildUI() {
const pageFiles = Object.keys(global.Hydro.ui.manifest).filter((i) => /\.page\.[jt]sx?$/.test(i));
const build = await esbuild.build({
format: 'iife',
@@ -61,13 +61,13 @@ async function run() {
const version = c.digest('hex');
constant = JSON.stringify(payload);
UiContextBase.constantVersion = hash = version;
}
bus.on('app/started', buildUI);
bus.on('system/setting', () => {
[UiContextBase.nav_logo_dark, UiContextBase.nav_logo_dark_2x] = system.getMany([
'ui-default.nav_logo_dark', 'ui-default.nav_logo_dark_2x',
]);
}
bus.on('app/started', run);
bus.on('system/setting', run);
});
class WikiHelpHandler extends Handler {
noCheckPermView = true;
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@hydrooj/ui-default",
"version": "4.38.27",
"version": "4.38.28",
"author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0",
"main": "hydro.js",