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 👌 (#2941)
  • Loading branch information
CREDO23 committed Aug 22, 2024
1 parent ed51f03 commit ca4c1ff
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 @@ -32,13 +32,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]);

// Put tasks without estimates at the top of the list
const sortedTasks = useMemo(
Expand Down

0 comments on commit ca4c1ff

Please sign in to comment.