From 04d6e340732cfc8ecb6abda57d99ea26c0aaf736 Mon Sep 17 00:00:00 2001 From: Jaden <91136545+onionware-github@users.noreply.github.com> Date: Tue, 13 Jun 2023 14:25:43 +0200 Subject: [PATCH] Bugfix: Multiple command execution on button click --- .../FreeDesktopNotificationManager.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DesktopNotifications.FreeDesktop/FreeDesktopNotificationManager.cs b/DesktopNotifications.FreeDesktop/FreeDesktopNotificationManager.cs index c95b88c..48c18ae 100644 --- a/DesktopNotifications.FreeDesktop/FreeDesktopNotificationManager.cs +++ b/DesktopNotifications.FreeDesktop/FreeDesktopNotificationManager.cs @@ -158,10 +158,11 @@ private void OnNotificationActionInvokedError(Exception obj) private void OnNotificationActionInvoked((uint id, string actionKey) @event) { - if (!_activeNotifications.TryGetValue(@event.id, out var notification)) return; + if (!_activeNotifications.TryGetValue(@event.id, out var notification) || notification is null) return; NotificationActivated?.Invoke(this, new NotificationActivatedEventArgs(notification, @event.actionKey)); + _activeNotifications.Remove(@event.id); } } }