summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLASER-Yi <[email protected]>2022-02-21 22:06:42 +0800
committerLASER-Yi <[email protected]>2022-02-21 22:06:49 +0800
commit4bf0555ece29fad429eb967711007d1fb29abd82 (patch)
tree9c4b2ec264f58c3e9a36d996fffa19a1c6dc4257
parent4a777c13c82cd5a8e81e92cfc7b02371ba40e291 (diff)
downloadbazarr-4bf0555ece29fad429eb967711007d1fb29abd82.tar.gz
bazarr-4bf0555ece29fad429eb967711007d1fb29abd82.zip
Fix a issue that language profiles won't show in some situations
-rw-r--r--frontend/src/pages/Settings/Languages/table.tsx12
1 files changed, 2 insertions, 10 deletions
diff --git a/frontend/src/pages/Settings/Languages/table.tsx b/frontend/src/pages/Settings/Languages/table.tsx
index 7c5dd0121..20e54bf53 100644
--- a/frontend/src/pages/Settings/Languages/table.tsx
+++ b/frontend/src/pages/Settings/Languages/table.tsx
@@ -1,12 +1,7 @@
import { faTrash, faWrench } from "@fortawesome/free-solid-svg-icons";
import { ActionButton, SimpleTable, useShowModal } from "components";
import { cloneDeep } from "lodash";
-import React, {
- FunctionComponent,
- useCallback,
- useMemo,
- useState,
-} from "react";
+import React, { FunctionComponent, useCallback, useMemo } from "react";
import { Badge, Button, ButtonGroup } from "react-bootstrap";
import { Column, TableUpdater } from "react-table";
import { useEnabledLanguagesContext, useProfilesContext } from ".";
@@ -16,12 +11,10 @@ import Modal from "./modal";
import { anyCutoff } from "./options";
const Table: FunctionComponent = () => {
- const originalProfiles = useProfilesContext();
+ const profiles = useProfilesContext();
const languages = useEnabledLanguagesContext();
- const [profiles, setProfiles] = useState(() => cloneDeep(originalProfiles));
-
const nextProfileId = useMemo(
() =>
1 +
@@ -36,7 +29,6 @@ const Table: FunctionComponent = () => {
const submitProfiles = useCallback(
(list: Language.Profile[]) => {
update(list, languageProfileKey);
- setProfiles(list);
},
[update]
);