core&ui: language selection bug fix

This commit is contained in:
undefined committed 2022-09-10 16:42:50 +08:00
1 parent f1b1c89bf1
commit ff0d172dd3
7 files changed
+36 -23

No files matched your search

@@ -3,6 +3,7 @@ import $ from 'jquery';
import yaml from 'js-yaml';
import React from 'react';
import { createRoot } from 'react-dom/client';
import Notification from 'vj/components/notification';
import { downloadProblemSet } from 'vj/components/zipDownloader';
import { NamedPage } from 'vj/misc/Page';
import delay from 'vj/utils/delay';
@@ -5,6 +5,10 @@ import getAvailableLangs from 'vj/utils/availableLangs';
const page = new NamedPage(['problem_submit', 'contest_detail_problem_submit', 'homework_detail_problem_submit'], async () => {
const { config } = UiContext.pdoc;
if (config.type === 'submit_answer') {
$('[name="lang"]').val('_');
return;
}
const availableLangs = getAvailableLangs(config.langs);
const mainLangs = {};
const preferences = [($('[name="lang"]').val() as string) || ''];