Fix: only reuse notification on XDG platforms

Fixes compilation on Windows
This commit is contained in:
Henrik Friedrichsen
2022-03-22 22:17:00 +01:00
parent 1a7b5f90da
commit ee6d26baf3

View File

@@ -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);
}