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]); }; 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" &&