From 0bd15caee6e995efcfb7bae78b0d3a2d09c733bd Mon Sep 17 00:00:00 2001 From: undefined Date: Fri, 21 Mar 2025 02:29:27 +0800 Subject: [PATCH] bug fix --- packages/hydrooj/src/handler/domain.ts | 2 +- packages/ui-default/pages/problem_submit.page.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/hydrooj/src/handler/domain.ts b/packages/hydrooj/src/handler/domain.ts index b36c6711c..9f778e48c 100644 --- a/packages/hydrooj/src/handler/domain.ts +++ b/packages/hydrooj/src/handler/domain.ts @@ -326,7 +326,7 @@ class DomainJoinHandler extends Handler { async prepare({ domainId }, target: string = domainId) { const [ddoc, dudoc] = await Promise.all([ domain.get(target), - domain.collUser.findOne({ domainId, uid: this.user._id }), + domain.collUser.findOne({ domainId: target, uid: this.user._id }), ]); const assignedRole = this.user.hasPriv(PRIV.PRIV_MANAGE_ALL_DOMAIN) ? 'root' diff --git a/packages/ui-default/pages/problem_submit.page.tsx b/packages/ui-default/pages/problem_submit.page.tsx index 7548af5ab..f429e4edb 100644 --- a/packages/ui-default/pages/problem_submit.page.tsx +++ b/packages/ui-default/pages/problem_submit.page.tsx @@ -25,7 +25,9 @@ const page = new NamedPage(['problem_submit', 'contest_detail_problem_submit', ' } for (const key in availableLangs) { if (config.langs && !config.langs.filter((i) => i === key || i.startsWith(`${key}.`)).length) continue; - if (window.LANGS[key].pretest?.split('.')[0] === preferences[0].split('.')[0]) preferences.push(key); + if (typeof window.LANGS[key]?.pretest === 'string' && window.LANGS[key].pretest.split('.')[0] === preferences[0].split('.')[0]) { + preferences.push(key); + } } renderLanguageSelect(