🐛 fix(parameterComponent): remove unnecessary useEffect hook that sets dictArr state

🐛 fix(parameterComponent): update value prop of KeypairListComponent to use convertObjToArray(dict) instead of dict
This commit is contained in:
Cristhian Zanforlin Lousa 2023-09-15 08:47:51 -03:00
commit dd556c518d

View file

@ -118,10 +118,6 @@ export default function ParameterComponent({
} as {});
const [dictArr, setDictArr] = useState([] as string[]);
useEffect(() => {
setDictArr(convertObjToArray(dict));
}, [dict]);
useEffect(() => {
if (name === "openai_api_base") console.log(info);
// @ts-ignore
@ -387,7 +383,7 @@ export default function ParameterComponent({
<KeypairListComponent
disabled={disabled}
editNode={false}
value={data.node!.template[name].value ?? dict}
value={data.node!.template[name].value ?? convertObjToArray(dict)}
duplicateKey={errorDuplicateKey}
onChange={(newValue: string[]) => {
setErrorDuplicateKey(hasDuplicateKeys(newValue));