mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core&ui: language selection bug fix
This commit is contained in:
1 parent
f1b1c89bf1
commit
ff0d172dd3
7 files changed
+36
-23
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/ui-default",
|
||||
"version": "4.40.3",
|
||||
"version": "4.40.4",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"license": "AGPL-3.0",
|
||||
"main": "hydro.js",
|
||||
|
||||
@@ -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) || ''];
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<div class="hasjs--hide">
|
||||
{{ form.form_select({
|
||||
label:'Code language',
|
||||
options:model.setting.SETTINGS_BY_KEY['codeLang'].range,
|
||||
options:langRange,
|
||||
name:'lang',
|
||||
value:handler.user.codeLang
|
||||
}) }}
|
||||
|
||||
Reference in new issue
Block a user