From bb9688d43051c19cc2dc697389547470d8c18f62 Mon Sep 17 00:00:00 2001 From: RanXom Date: Fri, 12 Jun 2026 23:15:51 +0530 Subject: Handle session switch manage on timer expiration --- src/pomo/state.rs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/pomo/state.rs') diff --git a/src/pomo/state.rs b/src/pomo/state.rs index 2a59042..d53bc69 100644 --- a/src/pomo/state.rs +++ b/src/pomo/state.rs @@ -158,20 +158,21 @@ impl Pomo { "Ref! Do Something! The break's over!", ]; - if self.auto_switch_sessions { - // Use the remaining duration/break count as a seed for simple 'random' selection - let idx = (self.break_count as usize) % 4; + // Use the remaining duration/break count as a seed for simple 'random' selection + let idx = (self.break_count as usize) % 4; + + let (title, msg) = match self.mode { + SessionMode::Work => ("Focus Block Complete", focus_msg[idx]), + _ => ("Break Over", break_msg[idx]), + }; - let (title, msg) = match self.mode { - SessionMode::Work => ("Focus Block Complete", focus_msg[idx]), - _ => ("Break Over", break_msg[idx]), - }; + self.send_notification(title, msg); - self.send_notification(title, msg); + if self.auto_switch_sessions { self.transition_next_session(); self.is_running = true; } else { - // TODO: Handle manual session switching + self.is_running = false; } } } -- cgit v1.2.3