Skip to content

Commit

Permalink
Merge pull request #1969 from ever-co/fix/#1968-timer-button
Browse files Browse the repository at this point in the history
fix: #1968 Timer Button Enable condition
  • Loading branch information
evereq authored Dec 7, 2023
2 parents aa398b4 + a2244ec commit 4a9ba80
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 4a9ba80

Please sign in to comment.