diff --git a/apps/web/app/hooks/features/useStartStopTimerHandler.ts b/apps/web/app/hooks/features/useStartStopTimerHandler.ts index 9760a68c0..48c5d74f8 100644 --- a/apps/web/app/hooks/features/useStartStopTimerHandler.ts +++ b/apps/web/app/hooks/features/useStartStopTimerHandler.ts @@ -88,7 +88,11 @@ export function useStartStopTimerHandler() { startTimer(); } } else { - openAddTasksEstimationHoursModal(); + if (tasksEstimateHoursModalDate != currentDate) { + openAddTasksEstimationHoursModal(); + } else { + startTimer(); + } } } else { startTimer(); diff --git a/apps/web/lib/features/daily-plan/add-daily-plan-work-hours-modal.tsx b/apps/web/lib/features/daily-plan/add-daily-plan-work-hours-modal.tsx index 115b7c694..aa66a0d35 100644 --- a/apps/web/lib/features/daily-plan/add-daily-plan-work-hours-modal.tsx +++ b/apps/web/lib/features/daily-plan/add-daily-plan-work-hours-modal.tsx @@ -28,13 +28,13 @@ export function AddDailyPlanWorkHourModal(props: IAddDailyPlanWorkHoursModalProp const handleCloseModal = useCallback(() => { localStorage.setItem(DAILY_PLAN_ESTIMATE_HOURS_MODAL_DATE, currentDate); closeModal(); - }, [closeModal, currentDate]); + startTimer(); + }, [closeModal, currentDate, startTimer]); const handleSubmit = useCallback(() => { updateDailyPlan({ workTimePlanned }, plan.id ?? ''); - startTimer(); handleCloseModal(); - }, [handleCloseModal, plan.id, startTimer, updateDailyPlan, workTimePlanned]); + }, [handleCloseModal, plan.id, updateDailyPlan, workTimePlanned]); return ( diff --git a/apps/web/lib/features/daily-plan/add-task-estimation-hours-modal.tsx b/apps/web/lib/features/daily-plan/add-task-estimation-hours-modal.tsx index f415c0413..dda0385bb 100644 --- a/apps/web/lib/features/daily-plan/add-task-estimation-hours-modal.tsx +++ b/apps/web/lib/features/daily-plan/add-task-estimation-hours-modal.tsx @@ -31,13 +31,14 @@ export function AddTasksEstimationHoursModal(props: IAddTasksEstimationHoursModa const handleCloseModal = useCallback(() => { localStorage.setItem(TASKS_ESTIMATE_HOURS_MODAL_DATE, currentDate); closeModal(); - }, [closeModal, currentDate]); + startTimer(); + }, [closeModal, currentDate, startTimer]); const handleSubmit = useCallback(() => { updateDailyPlan({ workTimePlanned }, plan.id ?? ''); - startTimer(); + handleCloseModal(); - }, [handleCloseModal, plan.id, startTimer, updateDailyPlan, workTimePlanned]); + }, [handleCloseModal, plan.id, updateDailyPlan, workTimePlanned]); return (