From cd9384729ae6e93cbdf94ae7e2af812781ccb794 Mon Sep 17 00:00:00 2001 From: Wahyu Ramadhan Date: Fri, 18 Aug 2023 10:17:54 +0700 Subject: [PATCH] fix gantt state --- src/views/SimproV2/CreatedProyek/DialogGantt.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/views/SimproV2/CreatedProyek/DialogGantt.js b/src/views/SimproV2/CreatedProyek/DialogGantt.js index 0f72d16..9d2f776 100644 --- a/src/views/SimproV2/CreatedProyek/DialogGantt.js +++ b/src/views/SimproV2/CreatedProyek/DialogGantt.js @@ -31,18 +31,13 @@ const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName const [humanResource, setHumanResource] = useState([]) useEffect(() => { - if (hierarchyId > 0 || idTask > 0 && !openDialogHierarchy) { + if (openDialog && hierarchyId > 0 || idTask > 0 && !openDialogHierarchy) { getdataGantt(); } - }, [hierarchyId, idTask, openDialog]) - - useEffect(() => { if (!openDialog) { setDataGantt([]); - } else { - } - }, [openDialog]) + }, [hierarchyId, idTask, openDialog]) const getDataHumanResource = async () => { const result = await axios