Skip to content

Commit

Permalink
fix: #1968 Timer Button Enable condition
Browse files Browse the repository at this point in the history
  • Loading branch information
badalkhatri0924 committed Dec 7, 2023
1 parent 6844b65 commit a2244ec
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
7 changes: 4 additions & 3 deletions apps/web/app/hooks/features/useTimer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,10 @@ export function useTimer() {
const lastActiveTeamId = useRef<string | null>(null);
const lastActiveTaskId = useRef<string | null>(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(
Expand Down
1 change: 0 additions & 1 deletion apps/web/lib/features/task/task-displays.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<Tooltip label={task?.title || ''} placement="top" enabled={(task?.title && task?.title.length > 60) || false}>
<span className="flex">
Expand Down
2 changes: 1 addition & 1 deletion apps/web/lib/features/timer/timer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
/>
</Tooltip>
Expand Down

0 comments on commit a2244ec

Please sign in to comment.