diff --git a/src/frontend/src/components/inputGlobalComponent/index.tsx b/src/frontend/src/components/inputGlobalComponent/index.tsx index 0d1b0ea40..6bd598778 100644 --- a/src/frontend/src/components/inputGlobalComponent/index.tsx +++ b/src/frontend/src/components/inputGlobalComponent/index.tsx @@ -23,6 +23,7 @@ export default function InputGlobalComponent({ ); const getVariableId = useGlobalVariablesStore((state) => state.getVariableId); + const unavaliableFields = useGlobalVariablesStore((state) => state.unavaliableFields); const removeGlobalVariable = useGlobalVariablesStore( (state) => state.removeGlobalVariable ); @@ -39,6 +40,15 @@ export default function InputGlobalComponent({ } }, [globalVariablesEntries]); + useEffect(() => { + if (!data.node?.template[name].value && data.node?.template[name].display_name) { + if(unavaliableFields[data.node?.template[name].display_name!]){ + setDb(true); + onChange(unavaliableFields[data.node?.template[name].display_name!]); + } + } + },[unavaliableFields]); + function handleDelete(key: string) { const id = getVariableId(key); if (id !== undefined) {