From a2244ecd979dedb9d55d6b3e1c4174354d212119 Mon Sep 17 00:00:00 2001 From: Badal Khatri Date: Thu, 7 Dec 2023 13:50:26 +0530 Subject: [PATCH] fix: #1968 Timer Button Enable condition --- apps/web/app/hooks/features/useTimer.ts | 7 ++++--- apps/web/lib/features/task/task-displays.tsx | 1 - apps/web/lib/features/timer/timer.tsx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/web/app/hooks/features/useTimer.ts b/apps/web/app/hooks/features/useTimer.ts index c24f0b132..516be6730 100644 --- a/apps/web/app/hooks/features/useTimer.ts +++ b/apps/web/app/hooks/features/useTimer.ts @@ -178,9 +178,10 @@ export function useTimer() { const lastActiveTeamId = useRef(null); const lastActiveTaskId = useRef(null); const canRunTimer = - (!!activeTeamTask && activeTeamTask.status !== 'closed') || - // If timer is running at some other source and user may or may not have selected the task - timerStatusRef.current?.lastLog?.source !== TimerSource.TEAMS; + user?.isEmailVerified && + ((!!activeTeamTask && activeTeamTask.status !== 'closed') || + // If timer is running at some other source and user may or may not have selected the task + timerStatusRef.current?.lastLog?.source !== TimerSource.TEAMS); // Local time status const { timeCounter, updateLocalTimerStatus, timerSeconds } = useLocalTimeCounter( diff --git a/apps/web/lib/features/task/task-displays.tsx b/apps/web/lib/features/task/task-displays.tsx index 01c05d44a..7813350f9 100644 --- a/apps/web/lib/features/task/task-displays.tsx +++ b/apps/web/lib/features/task/task-displays.tsx @@ -37,7 +37,6 @@ export function TaskNameInfoDisplay({ const color: string = taskSizeColor[size].color; // @ts-expect-error const short: string = taskSizeColor[size].short; - console.log(task?.size); return ( 60) || false}> diff --git a/apps/web/lib/features/timer/timer.tsx b/apps/web/lib/features/timer/timer.tsx index 0475e221e..8f5d37bfb 100644 --- a/apps/web/lib/features/timer/timer.tsx +++ b/apps/web/lib/features/timer/timer.tsx @@ -108,7 +108,7 @@ export function Timer({ className }: IClassName) { running={timerStatus?.running} disabled={ // If timer is running at some other source and user may or may not have selected the task - disabled && timerStatus?.lastLog?.source !== TimerSource.TEAMS + !canRunTimer || (disabled && timerStatus?.lastLog?.source !== TimerSource.TEAMS) } />