Skip to content

Commit

Permalink
fixbug: SOFT FLOW, popups logic when user added the today plan yester…
Browse files Browse the repository at this point in the history
…day 👌
  • Loading branch information
CREDO23 committed Aug 20, 2024
1 parent 31aa333 commit ece7331
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
6 changes: 5 additions & 1 deletion apps/web/app/hooks/features/useStartStopTimerHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ export function useStartStopTimerHandler() {
startTimer();
}
} else {
openAddTasksEstimationHoursModal();
if (tasksEstimateHoursModalDate != currentDate) {
openAddTasksEstimationHoursModal();
} else {
startTimer();
}
}
} else {
startTimer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<Modal isOpen={isOpen} closeModal={handleCloseModal} showCloseIcon={requirePlan ? false : true}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<Modal isOpen={isOpen} closeModal={handleCloseModal} showCloseIcon={requirePlan ? false : true}>
Expand Down

0 comments on commit ece7331

Please sign in to comment.