Skip to content

Commit 8966c9e

Browse files
OS Config first two dropdowns (german & english) should be disabled
1 parent 97185bf commit 8966c9e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/components/config/Config.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ export default function Config() {
5959
setPreparedOptions(removeDuplicates);
6060
}, [tokenizerValues, localConfig]);
6161

62+
useEffect(() => {
63+
return () => {
64+
ConfigManager.refreshConfig();
65+
}
66+
}, []);
67+
6268
function checkAndSaveValue(value: any, key: string, subkey: string = null) {
6369
if (key == "limit_checks") {
6470
if (Number(value) == organization[snakeCaseToCamelCase(subkey)]) return;
@@ -88,8 +94,6 @@ export default function Config() {
8894
updateConfigMut({ variables: { dictStr: JSON.stringify(updateDict) } }).then((res) => {
8995
if (!res?.data?.updateConfig) {
9096
window.alert('something went wrong with the update');
91-
} else {
92-
ConfigManager.refreshConfig();
9397
}
9498
});
9599
}
@@ -184,6 +188,7 @@ export default function Config() {
184188
dropdownItemsClasses="max-h-80 overflow-y-auto"
185189
buttonClasses="whitespace-nowrap"
186190
dropdownWidth="w-72"
191+
disabled={index < 2}
187192
/>
188193
{index > 1 && <button className="px-1 inline-flex items-center">
189194
<IconTrash onClick={() => removeSpacyTokenizer(myConfig)} className="h-6 w-6 text-red-700" />

0 commit comments

Comments
 (0)