From 81bd3666540f582410f1989d7c6072c866955827 Mon Sep 17 00:00:00 2001 From: Cristhian Zanforlin Lousa Date: Thu, 14 Sep 2023 14:39:07 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20refactor(parameterComponent):=20?= =?UTF-8?q?update=20initial=20state=20of=20dict=20to=20include=20a=20defau?= =?UTF-8?q?lt=20key-value=20pair=20for=20better=20clarity=20and=20consiste?= =?UTF-8?q?ncy=20=F0=9F=94=A8=20refactor(EditNodeModal):=20update=20initia?= =?UTF-8?q?l=20state=20of=20dict=20to=20include=20a=20default=20key-value?= =?UTF-8?q?=20pair=20for=20better=20clarity=20and=20consistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GenericNode/components/parameterComponent/index.tsx | 4 +++- src/frontend/src/modals/EditNodeModal/index.tsx | 7 +------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx index bc03603be..7f5f5dc84 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx @@ -115,7 +115,9 @@ export default function ParameterComponent({ }); const [errorDuplicateKey, setErrorDuplicateKey] = useState(false); - const [dict, setDict] = useState({} as {}); + const [dict, setDict] = useState({ + yourKey: "yourValue", + } as {}); const [dictArr, setDictArr] = useState([] as string[]); useEffect(() => { diff --git a/src/frontend/src/modals/EditNodeModal/index.tsx b/src/frontend/src/modals/EditNodeModal/index.tsx index 4e1e2bb83..abc9e0aff 100644 --- a/src/frontend/src/modals/EditNodeModal/index.tsx +++ b/src/frontend/src/modals/EditNodeModal/index.tsx @@ -101,12 +101,7 @@ const EditNodeModal = forwardRef( const [errorDuplicateKey, setErrorDuplicateKey] = useState(false); const [dict, setDict] = useState({ - key1: "value1", - key2: "value2", - key3: "value3", - key4: "value4", - key5: "value5", - key6: "value6", + yourKey: "yourValue", } as {}); const [dictArr, setDictArr] = useState([] as string[]);