diff --git a/desktop/tauri/src-tauri/src/traymenu.rs b/desktop/tauri/src-tauri/src/traymenu.rs index 20a19e37..c26d104e 100644 --- a/desktop/tauri/src-tauri/src/traymenu.rs +++ b/desktop/tauri/src-tauri/src/traymenu.rs @@ -423,7 +423,7 @@ pub async fn tray_handler(cli: PortAPI, app: tauri::AppHandle) { Ok(rx) => rx, Err(err) => { error!( - "cancel try_handler: failed to subscribe to 'runtime:subsystems': {}", + "cancel try_handler: failed to subscribe to 'runtime:system/status': {}", err ); return; @@ -594,7 +594,18 @@ pub async fn tray_handler(cli: PortAPI, app: tauri::AppHandle) { } } } + + update_icon_nostate(icon.clone()); +} + +pub fn update_icon_nostate(icon: AppIcon) { update_icon_color(&icon, IconColor::Red); + + if let Ok(menu) = build_tray_menu(icon.app_handle(), "unknown", "unknown", &system_status_types::PauseInfo::default()) { + if let Err(err) = icon.set_menu(Some(menu)) { + error!("failed to set menu on tray icon: {}", err.to_string()); + } + } } fn update_icon_color(icon: &AppIcon, new_color: IconColor) { diff --git a/service/control/pause.go b/service/control/pause.go index 73b69f31..b3aa3480 100644 --- a/service/control/pause.go +++ b/service/control/pause.go @@ -155,7 +155,26 @@ func (c *Control) startResumeWorker(duration time.Duration) { } case <-time.After(duration): wc.Info("Resuming...") - return c.resume() + + err := c.resume() + if err == nil { + n := ¬ifications.Notification{ + EventID: "control:resumed", + Type: notifications.Info, + Title: "Resumed", + Message: "Automatically resumed from pause state", + ShowOnSystem: true, + Expires: time.Now().Add(15 * time.Second).Unix(), + AvailableActions: []*notifications.Action{ + { + ID: "ack", + Text: "OK", + }, + }, + } + notifications.Notify(n) + } + return err } } }