From 282a368a022f280bc4e00f3e2547791d3e14aa17 Mon Sep 17 00:00:00 2001 From: wahyun Date: Fri, 2 Feb 2024 17:34:55 +0700 Subject: [PATCH] set false loading spinner --- .../SimproV2/CreatedProyek/ImportActivity/index.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/views/SimproV2/CreatedProyek/ImportActivity/index.js b/src/views/SimproV2/CreatedProyek/ImportActivity/index.js index ef9d755..eb0efed 100644 --- a/src/views/SimproV2/CreatedProyek/ImportActivity/index.js +++ b/src/views/SimproV2/CreatedProyek/ImportActivity/index.js @@ -93,6 +93,7 @@ const ImportActivity = ({ params }) => { // const [isMovePage, setIsMovePage] = useState(false); const [isPreview, setIsPreview] = useState(false); + const [loading, setLoading] = useState(true); useEffect(() => { getDataAssignHr(); @@ -130,7 +131,9 @@ const ImportActivity = ({ params }) => { if (result && result.data && result.data.code == 200) { let dataRes = result.data.data || [] setdataUserToProject(dataRes); + setLoading(false) } else { + setLoading(false) NotificationManager.error('Gagal Mengambil Data!!', 'Failed'); } } @@ -250,8 +253,11 @@ const ImportActivity = ({ params }) => { const timestamp = Date.now(); const newTimestamp = timestamp + 60000; window.location = urlSplitted[0] + '//' + urlSplitted[2] + `/#/projects/` + ganttId + '/' + result.data.projectId + '/' + newTimestamp + '/gantt' - } - + setLoading(false) + }else{ + setLoading(false) + } + setLoading(false) setIsMovePage(true); setIsPreview(true); } @@ -369,7 +375,7 @@ const ImportActivity = ({ params }) => {

Data Preview

- + index % 2 == 0 ? 'table-row-light' : 'table-row-dark'} dataSource={dataTable}