diff options
| author | RanXom <saiyedshizain@gmail.com> | 2026-06-12 23:15:51 +0530 |
|---|---|---|
| committer | RanXom <saiyedshizain@gmail.com> | 2026-06-12 23:15:51 +0530 |
| commit | bb9688d43051c19cc2dc697389547470d8c18f62 (patch) | |
| tree | dcd10f61a0be093e5d4c1753618b37b93170c35e /src/pomo/state.rs | |
| parent | c2cd16b5993526d95d91326683f0f8338f63a9eb (diff) | |
| download | pomoru-bb9688d43051c19cc2dc697389547470d8c18f62.tar.xz pomoru-bb9688d43051c19cc2dc697389547470d8c18f62.zip | |
Handle session switch manage on timer expiration
Diffstat (limited to 'src/pomo/state.rs')
| -rw-r--r-- | src/pomo/state.rs | 19 |
1 files changed, 10 insertions, 9 deletions
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; } } } |