mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
ui: fix preferenceLang display on problem submit (#573)
This commit is contained in:
1 parent
72faf6c8d3
commit
855db6b64a
1 file changed
+1
-1
@@ -13,7 +13,7 @@ const page = new NamedPage(['problem_submit', 'contest_detail_problem_submit', '
|
|||||||
}
|
}
|
||||||
const availableLangs = getAvailableLangs(config.langs);
|
const availableLangs = getAvailableLangs(config.langs);
|
||||||
const mainLangs = {};
|
const mainLangs = {};
|
||||||
const preferences = [($('[name="lang"]').val() as string) || ''];
|
const preferences = [UserContext.codeLang || ''];
|
||||||
for (const key in availableLangs) {
|
for (const key in availableLangs) {
|
||||||
if (config.langs && !config.langs.filter((i) => i === key || i.startsWith(`${key}.`)).length) continue;
|
if (config.langs && !config.langs.filter((i) => i === key || i.startsWith(`${key}.`)).length) continue;
|
||||||
if (window.LANGS[key].pretest === preferences[0]) preferences.push(key);
|
if (window.LANGS[key].pretest === preferences[0]) preferences.push(key);
|
||||||
|
|||||||
Reference in new issue
Block a user