From ee6d26baf3ba6a817e93e74f29c99e1bae17c926 Mon Sep 17 00:00:00 2001 From: Henrik Friedrichsen Date: Tue, 22 Mar 2022 22:17:00 +0100 Subject: [PATCH] Fix: only reuse notification on XDG platforms Fixes compilation on Windows --- src/queue.rs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/queue.rs b/src/queue.rs index 0d902bd..f2d2fa5 100644 --- a/src/queue.rs +++ b/src/queue.rs @@ -446,13 +446,17 @@ pub fn send_notification( }; if let Ok(n) = res { - let new_notification_id = n.id(); - log::debug!( - "new notification id: {}, previously: {}", - new_notification_id, - current_notification_id - ); - notification_id.store(new_notification_id, std::sync::atomic::Ordering::Relaxed); + // only available for XDG + #[cfg(all(unix, not(target_os = "macos")))] + { + let new_notification_id = n.id(); + log::debug!( + "new notification id: {}, previously: {}", + new_notification_id, + current_notification_id + ); + notification_id.store(new_notification_id, std::sync::atomic::Ordering::Relaxed); + } } else if let Err(e) = res { error!("Failed to send notification cover: {}", e); }