Function: reconstructPomodoroState()
function reconstructPomodoroState( timer, totalElapsed, settings): { phase: "focus" | "short-break" | "long-break"; phaseStartTime: number; sessionsCompleted: number;};Defined in: shared/src/helper/pomodoroHelper/pomodoroFunctions.ts:99
Reconstruct Pomodoro state after browser refresh Calculates which phase the timer should be in based on total elapsed time
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
timer | { appointment_id: string | null; created_at: string; delta_end_time: number; delta_start_time: number; id: string; memo: string | null; order_index: number; pomodoro_enabled: boolean; pomodoro_focus_duration: number | null; pomodoro_long_break_duration: number | null; pomodoro_phase: "focus" | "short-break" | "long-break"; pomodoro_phase_overtime: boolean; pomodoro_phase_start_time: string | null; pomodoro_sessions_completed: number; pomodoro_sessions_until_long_break: number | null; pomodoro_short_break_duration: number | null; round_in_time_fragments: boolean | null; rounding_direction: "up" | "down" | "nearest" | null; rounding_interval: number | null; start_time: string | null; state: "running" | "stopped"; time_fragment_interval: number | null; user_id: string; work_project_id: string; } |
timer.appointment_id | string | null |
timer.created_at | string |
timer.delta_end_time | number |
timer.delta_start_time | number |
timer.id | string |
timer.memo | string | null |
timer.order_index | number |
timer.pomodoro_enabled | boolean |
timer.pomodoro_focus_duration | number | null |
timer.pomodoro_long_break_duration | number | null |
timer.pomodoro_phase | "focus" | "short-break" | "long-break" |
timer.pomodoro_phase_overtime | boolean |
timer.pomodoro_phase_start_time | string | null |
timer.pomodoro_sessions_completed | number |
timer.pomodoro_sessions_until_long_break | number | null |
timer.pomodoro_short_break_duration | number | null |
timer.round_in_time_fragments | boolean | null |
timer.rounding_direction | "up" | "down" | "nearest" | null |
timer.rounding_interval | number | null |
timer.start_time | string | null |
timer.state | "running" | "stopped" |
timer.time_fragment_interval | number | null |
timer.user_id | string |
timer.work_project_id | string |
totalElapsed | number |
settings | PomodoroSettings |
Returns
Section titled “Returns”{ phase: "focus" | "short-break" | "long-break"; phaseStartTime: number; sessionsCompleted: number;}| Name | Type | Defined in |
|---|---|---|
phase | "focus" | "short-break" | "long-break" | shared/src/helper/pomodoroHelper/pomodoroFunctions.ts:104 |
phaseStartTime | number | shared/src/helper/pomodoroHelper/pomodoroFunctions.ts:105 |
sessionsCompleted | number | shared/src/helper/pomodoroHelper/pomodoroFunctions.ts:106 |