mirror of
https://github.com/safing/portbase
synced 2025-04-21 09:49:10 +00:00
Close action trigger when notification is deleted
This commit is contained in:
parent
88f974fa66
commit
7cd682c894
1 changed files with 11 additions and 0 deletions
|
@ -393,6 +393,17 @@ func (n *Notification) Update(expires int64) {
|
||||||
|
|
||||||
// Delete (prematurely) cancels and deletes a notification.
|
// Delete (prematurely) cancels and deletes a notification.
|
||||||
func (n *Notification) Delete() {
|
func (n *Notification) Delete() {
|
||||||
|
// Dismiss notification.
|
||||||
|
func() {
|
||||||
|
n.lock.Lock()
|
||||||
|
defer n.lock.Unlock()
|
||||||
|
|
||||||
|
if n.actionTrigger != nil {
|
||||||
|
close(n.actionTrigger)
|
||||||
|
n.actionTrigger = nil
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
n.delete(true)
|
n.delete(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue