From 8912151bdceb0dff4b049d5ac1db4aeae6761ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 16 Aug 2023 17:09:02 +0200 Subject: [PATCH 1/2] fix: pausing of timers/pomodoro not working --- src/timer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/timer.rs b/src/timer.rs index c8226fa..af2ca46 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -34,7 +34,7 @@ impl Timer { /// Returns `true` if this [`Timer`] has expired pub fn is_expired(&self) -> bool { - let expired = Instant::now() - self.start > self.duration; + let expired = self.remaining().is_zero(); if expired { self.handle_expiration() }; From 37dc5c727a3d73778d6ee9d63c1468357cf0ed72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 16 Aug 2023 17:11:13 +0200 Subject: [PATCH 2/2] feat: make notification urgency critical --- src/helper.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helper.rs b/src/helper.rs index ecd9b90..454f983 100644 --- a/src/helper.rs +++ b/src/helper.rs @@ -9,7 +9,7 @@ pub fn run_path() -> String { } pub fn send_notifictation(msg: &str) { - match Notification::new().summary("󰀠 Timers").body(msg).show() { + match Notification::new().summary("󰀠 Timers").body(msg).urgency(notify_rust::Urgency::Critical).show() { Ok(_) => println!("Sent notification sucessfully."), Err(_) => println!("Failed to send notification."), };