🐛 fix(parameterComponent): remove redundant conditional statement and set dictionary array and node template value directly

The conditional statement checking for duplicate keys and setting the dictionary array was redundant. Instead, the dictionary array is now always set to the new value. Additionally, the node template value is now always updated with the new value.
This commit is contained in:
Cristhian Zanforlin Lousa 2023-09-15 16:07:08 -03:00
commit 4a03e81314

View file

@ -389,12 +389,8 @@ export default function ParameterComponent({
duplicateKey={errorDuplicateKey}
onChange={(newValue) => {
setErrorDuplicateKey(hasDuplicateKeys(newValue));
if (hasDuplicateKeys(newValue)) {
setDictArr(newValue);
} else {
setDictArr(newValue);
data.node!.template[name].value = newValue;
}
setDictArr(newValue);
data.node!.template[name].value = newValue;
}}
/>
</div>