fix(desktop): gate set_badge_label behind macOS cfg
Windows/Linux WebviewWindow have no set_badge_label method — build failed on GitHub Actions windows runner.
This commit is contained in:
@@ -171,8 +171,10 @@ pub fn run() {
|
||||
format!("ChatApp · {} neu", payload.count)
|
||||
};
|
||||
let _ = tray_handle.set_tooltip(Some(tooltip));
|
||||
// macOS dock badge. `set_badge_label` is macOS-only but the
|
||||
// call is a no-op on other platforms so we don't need a cfg.
|
||||
// Dock/taskbar badge. `set_badge_label` is macOS-only.
|
||||
// Windows taskbar uses an overlay icon (different API).
|
||||
// Linux has no cross-DE badge API — skip.
|
||||
#[cfg(target_os = "macos")]
|
||||
if let Some(win) = badge_window.as_ref() {
|
||||
let badge = if payload.count == 0 {
|
||||
None
|
||||
@@ -181,6 +183,8 @@ pub fn run() {
|
||||
};
|
||||
let _ = win.set_badge_label(badge);
|
||||
}
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
let _ = &badge_window;
|
||||
});
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user