Fix issues in language profile modal

This commit is contained in:
LASER-Yi 2021-04-20 01:42:24 +08:00
parent e462686c17
commit 65e68d4409
2 changed files with 5 additions and 4 deletions

View File

@ -16,7 +16,7 @@ export const LanguageSelector: FunctionComponent<
return (
<CLanguageSelector
multiple
defaultValue={enabled}
value={enabled}
options={options}
onChange={(val) => {
update(val, settingKey);

View File

@ -19,6 +19,7 @@ import {
useCloseModal,
usePayload,
} from "../../components";
import { BuildKey } from "../../utilites";
import { Input, Message } from "../components";
import { cutoffOptions } from "./options";
interface Props {
@ -170,7 +171,7 @@ const LanguagesProfileModal: FunctionComponent<Props & BaseModalProps> = (
return (
<Form.Check
custom
id={`${item.language}-forced`}
id={BuildKey(item.id, item.language, "forced")}
checked={value === "True"}
onChange={(v) => {
item.forced = v.target.checked ? "True" : "False";
@ -188,7 +189,7 @@ const LanguagesProfileModal: FunctionComponent<Props & BaseModalProps> = (
return (
<Form.Check
custom
id={`${item.language}-hi`}
id={BuildKey(item.id, item.language, "hi")}
checked={value === "True"}
onChange={(v) => {
item.hi = v.target.checked ? "True" : "False";
@ -206,7 +207,7 @@ const LanguagesProfileModal: FunctionComponent<Props & BaseModalProps> = (
return (
<Form.Check
custom
id={`${item.language}-audio`}
id={BuildKey(item.id, item.language, "audio")}
checked={value === "True"}
onChange={(v) => {
item.audio_exclude = v.target.checked ? "True" : "False";