From 64eb2e0f99cbb5b027cac0c268908d3cd771aec9 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Fri, 21 Jun 2024 12:26:57 -0300 Subject: [PATCH] refactor: Improve InputGlobalComponent behavior and data handling --- src/frontend/src/components/inputGlobalComponent/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/components/inputGlobalComponent/index.tsx b/src/frontend/src/components/inputGlobalComponent/index.tsx index 3f74d2c1d..92e24f42b 100644 --- a/src/frontend/src/components/inputGlobalComponent/index.tsx +++ b/src/frontend/src/components/inputGlobalComponent/index.tsx @@ -34,8 +34,8 @@ export default function InputGlobalComponent({ useEffect(() => { if (data) if ( - globalVariablesEntries && - !globalVariablesEntries.includes(data.value) && + ((globalVariablesEntries && + !globalVariablesEntries.includes(data.value))||!globalVariablesEntries) && data.load_from_db ) { setTimeout(() => { @@ -43,7 +43,7 @@ export default function InputGlobalComponent({ setDb(false); }, 100); } - }, [globalVariablesEntries]); + }, [globalVariablesEntries,data]); useEffect(() => { if (!data.value && data.display_name) {