From 7cd682c894b23cb3f4bf431a1a2a288b033c9e59 Mon Sep 17 00:00:00 2001
From: Daniel <dhaavi@users.noreply.github.com>
Date: Fri, 22 Dec 2023 14:21:18 +0100
Subject: [PATCH] Close action trigger when notification is deleted

---
 notifications/notification.go | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/notifications/notification.go b/notifications/notification.go
index 77034ea..aca4061 100644
--- a/notifications/notification.go
+++ b/notifications/notification.go
@@ -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)
 }