Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/client/components/pomodoro-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,6 @@ export function PomodoroPanel() {
// Flowtime uses a per-interval stopwatch; total elapsed work is displayed separately below.
const stopwatchSeconds = state.flowtimeWorkSeconds

// Don't render when no session is active
if (state.status === 'idle' && state.taskId === null) return null

const isFlowtime = state.mode === 'flowtime'
const isFlowtimeWork = isFlowtime && state.phase === 'work'
const showFlowtimeRestSelector = isFlowtimeWork && state.status === 'paused'
const showModeChangeResetHint =
state.status === 'paused' && modeAtPauseStart !== null && state.mode !== modeAtPauseStart

useEffect(() => {
if (state.status !== 'paused') {
setModeAtPauseStart(null)
Expand All @@ -76,6 +67,15 @@ export function PomodoroPanel() {
setModeAtPauseStart((prev) => prev ?? state.mode)
}, [state.mode, state.status])

// Don't render when no session is active
if (state.status === 'idle' && state.taskId === null) return null

const isFlowtime = state.mode === 'flowtime'
const isFlowtimeWork = isFlowtime && state.phase === 'work'
const showFlowtimeRestSelector = isFlowtimeWork && state.status === 'paused'
const showModeChangeResetHint =
state.status === 'paused' && modeAtPauseStart !== null && state.mode !== modeAtPauseStart

const timeDisplay = isFlowtimeWork
? formatSeconds(stopwatchSeconds) // Stopwatch counts up
: state.secondsRemaining !== null
Expand Down
Loading