From bf2a98d6caeb969c6dcb7ff06c6e69b1f8f7f91f Mon Sep 17 00:00:00 2001 From: kartikvirendrar Date: Sat, 9 Nov 2024 09:58:31 +0530 Subject: [PATCH 1/2] change update time spent timing to 5 minutes for VOTR --- src/hooks/useUpdateTimeSpent.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/hooks/useUpdateTimeSpent.js b/src/hooks/useUpdateTimeSpent.js index 35690d0a..1ee11607 100644 --- a/src/hooks/useUpdateTimeSpent.js +++ b/src/hooks/useUpdateTimeSpent.js @@ -1,6 +1,6 @@ import { useEffect } from "react"; import { useRef } from "react"; -import { useDispatch } from "react-redux"; +import { useDispatch, useSelector } from "react-redux"; import { useParams } from "react-router-dom"; import { APITransportUTS, UpdateTimeSpentPerTask } from "redux/actions"; @@ -8,6 +8,7 @@ export const useUpdateTimeSpent = (ref) => { const { taskId } = useParams(); const timeSpentIntervalRef = useRef(null); const dispatch = useDispatch(); + const taskDetails = useSelector((state) => state.getTaskDetails.data); useEffect(() => { const handleUpdateTimeSpent = (time = 60) => { @@ -17,14 +18,14 @@ export const useUpdateTimeSpent = (ref) => { timeSpentIntervalRef.current = setInterval( handleUpdateTimeSpent, - 60 * 1000 + taskDetails?.task_type?.includes("VOICEOVER") ? 5 * 60 * 1000 : 60 * 1000 ); const handleVisibilityChange = () => { if (!document.hidden) { timeSpentIntervalRef.current = setInterval( handleUpdateTimeSpent, - 60 * 1000 + taskDetails?.task_type?.includes("VOICEOVER") ? 5 * 60 * 1000 : 60 * 1000 ); } else { handleUpdateTimeSpent(ref.current); @@ -41,5 +42,5 @@ export const useUpdateTimeSpent = (ref) => { }; // eslint-disable-next-line - }, []); + }, [taskDetails]); }; From 353258ff4d6a3d8251238bb591ea54f174b93f4a Mon Sep 17 00:00:00 2001 From: kartikvirendrar Date: Sat, 9 Nov 2024 10:12:55 +0530 Subject: [PATCH 2/2] change update time spent timing to 5 minutes for VOTR --- .../actions/apitransport/apitransportUts.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/redux/actions/apitransport/apitransportUts.js b/src/redux/actions/apitransport/apitransportUts.js index 836e744a..194f4ac5 100644 --- a/src/redux/actions/apitransport/apitransportUts.js +++ b/src/redux/actions/apitransport/apitransportUts.js @@ -19,15 +19,15 @@ const success = (res, api, dispatch) => { dispatch(dispatchAPIAsync(api)); } - if (data.message) { - dispatch( - setSnackBar({ - open: true, - message: data.message, - variant: "success", - }) - ); - } + // if (data.message) { + // dispatch( + // setSnackBar({ + // open: true, + // message: data.message, + // variant: "success", + // }) + // ); + // } if ( typeof api.processNextSuccessStep === "function" &&