Skip to content

Commit

Permalink
Close action trigger when notification is deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaavi committed Dec 22, 2023
1 parent 88f974f commit 7cd682c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions notifications/notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,17 @@ func (n *Notification) Update(expires int64) {

// Delete (prematurely) cancels and deletes a notification.
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)
}

Expand Down

0 comments on commit 7cd682c

Please sign in to comment.