diff --git a/src/pomodoro.rs b/src/pomodoro.rs index 0194a02..cf065bf 100644 --- a/src/pomodoro.rs +++ b/src/pomodoro.rs @@ -52,6 +52,7 @@ impl Pomodoro { self.paused = Default::default(); } } + KeyCode::Char('r') | KeyCode::Char('R') => self.restart(), KeyCode::Char('q') | KeyCode::Char('Q') => break, KeyCode::Char('c') if key_event.modifiers == KeyModifiers::CONTROL => break, _ => {} @@ -64,6 +65,11 @@ impl Pomodoro { Ok(()) } + fn restart(&mut self) { + self.wait_start = Some(Instant::now()); + self.paused = Default::default(); + } + fn notify_complete(&self) -> Result<(), Box> { let mut toast = notify_rust::Notification::new(); toast.summary("Pomodoro cycle complete!");