ui: fix preferenceLang display on problem submit (#573)

This commit is contained in:
panda authored and GitHub committed 2023-05-11 15:04:52 +08:00
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 mainLangs = {};
const preferences = [($('[name="lang"]').val() as string) || ''];
const preferences = [UserContext.codeLang || ''];
for (const key in availableLangs) {
if (config.langs && !config.langs.filter((i) => i === key || i.startsWith(`${key}.`)).length) continue;
if (window.LANGS[key].pretest === preferences[0]) preferences.push(key);