fix after merging dev branch

This commit is contained in:
morpheus65535 2024-05-11 09:20:31 -04:00
parent 3aa504d83b
commit 16fd714a07
3 changed files with 7 additions and 11 deletions

View File

@ -30,7 +30,7 @@ const defaultCutoffOptions: SelectorOption<Language.ProfileItem>[] = [
// eslint-disable-next-line camelcase
audio_exclude: "False",
forced: "False",
hi: "False",
hi: "also",
language: "any",
},
},
@ -88,7 +88,7 @@ const ProfileEditForm: FunctionComponent<Props> = ({
form.values.items,
(v) => {
const suffix =
v.hi === "True" ? ":hi" : v.forced === "True" ? ":forced" : "";
v.hi === "only" ? ":hi" : v.forced === "True" ? ":forced" : "";
return v.language + suffix;
},
@ -190,12 +190,8 @@ const ProfileEditForm: FunctionComponent<Props> = ({
const selectValue = useMemo(() => {
if (item.forced === "True") {
return "forced";
} else if (item.hi === "also") {
return "also";
} else if (item.hi === "only") {
return "only";
} else if (item.hi === "never") {
return "never";
} else {
return item.hi;
}
}, [item.forced, item.hi]);
@ -209,7 +205,7 @@ const ProfileEditForm: FunctionComponent<Props> = ({
...item,
hi: value,
forced: value === "forced" ? "True" : "False",
});
} as Language.ProfileItem);
}
}}
></Select>

View File

@ -28,7 +28,7 @@ declare namespace Language {
id: number;
audio_exclude: PythonBoolean;
forced: PythonBoolean;
hi: string;
hi: "never" | "also" | "only";
language: CodeType;
}

View File

@ -33,7 +33,7 @@ export function useProfileItemsToLanguages(profile?: Language.Profile) {
profile?.items.map<Language.Info>(({ language: code, hi, forced }) => {
const name = data?.find((v) => v.code2 === code)?.name ?? "";
return {
hi: hi === "True",
hi: hi === "only",
forced: forced === "True",
code2: code,
name,