mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: fix lang list check
This commit is contained in:
2 files changed
+3
-3
No files matched your search
@@ -107,8 +107,8 @@ export const FileExistsError = Err('FileExistsError', ForbiddenError, 'File {0}
|
||||
export const HackFailedError = Err('HackFailedError', ForbiddenError, 'Hack failed: {0}');
|
||||
export const ProblemAlreadyExistError = Err('ProblemAlreadyExistError', ForbiddenError, 'Problem {0} already exists.');
|
||||
export const ProblemAlreadyUsedByContestError = Err('ProblemAlreadyUsedByContestError', ForbiddenError, 'Problem {0} is already used by contest {1}.');
|
||||
export const ProblemNotAllowPretestError = Err('ProblemNotAllowPretestError', ForbiddenError, 'This {0} is not allow run pretest.');
|
||||
export const ProblemNotAllowLanguageError = Err('ProblemNotAllowSubmitError', ForbiddenError, 'This language is not allow to submit.');
|
||||
export const ProblemNotAllowPretestError = Err('ProblemNotAllowPretestError', ForbiddenError, 'Pretesting is not supported for {0}.');
|
||||
export const ProblemNotAllowLanguageError = Err('ProblemNotAllowSubmitError', ForbiddenError, 'This language is not allowed to submit.');
|
||||
|
||||
export const HackRejudgeFailedError = Err('HackRejudgeFailedError', BadRequestError, 'Cannot rejudge a hack record.');
|
||||
export const CannotDeleteSystemDomainError = Err('CannotDeleteSystemDomainError', BadRequestError, 'You are not allowed to delete system domain.');
|
||||
|
||||
@@ -32,7 +32,7 @@ export function getAvailableLangs(langsList?: string[]) {
|
||||
const Langs = {};
|
||||
for (const key in window.LANGS) {
|
||||
if (prefixes.has(key)) continue;
|
||||
if (langsList && langsList.length && langsList.join('') && !langsList.includes(key)) continue;
|
||||
if ((langsList instanceof Array) && !langsList.includes(key)) continue;
|
||||
if (window.LANGS[key].hidden && !langsList?.includes(key)) continue;
|
||||
if (window.LANGS[key].disabled) continue;
|
||||
Langs[key] = window.LANGS[key];
|
||||
|
||||
Reference in new issue
Block a user