From d26ae224c7bf8d871ca3664e5e014855af6d455c Mon Sep 17 00:00:00 2001 From: undefined Date: Wed, 27 Mar 2024 14:21:20 +0800 Subject: [PATCH] ui: optimize template load --- package.json | 2 +- packages/ui-default/backendlib/template.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index bd81a06a6..712c8ae9e 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "semver": "^7.6.0", "simple-git": "^3.23.0", "supertest": "^6.3.4", - "typescript": "^5.3.3", + "typescript": "^5.4.3", "wtfnode": "^0.9.1" } } diff --git a/packages/ui-default/backendlib/template.ts b/packages/ui-default/backendlib/template.ts index 87330a9f0..768ec2b40 100644 --- a/packages/ui-default/backendlib/template.ts +++ b/packages/ui-default/backendlib/template.ts @@ -13,8 +13,8 @@ import * as misc from './misc'; const argv = require('cac')().parse(); let { template } = argv.options; -if (template && typeof template !== 'string') template = findFileSync('@hydrooj/ui-default/templates'); -else template &&= findFileSync(template); +if (!template || typeof template !== 'string') template = findFileSync('@hydrooj/ui-default/templates'); +else template = findFileSync(template); class Loader extends nunjucks.Loader { getSource(name) {