feat(control): add notification for automatic resume from pause state

This commit is contained in:
Alexandr Stelnykovych
2025-11-11 17:18:58 +02:00
parent 3406017754
commit 3abb2b3c69
2 changed files with 32 additions and 2 deletions

View File

@@ -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 := &notifications.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
}
}
}