Skip to content
This repository was archived by the owner on Jan 12, 2026. It is now read-only.

Conversation

@onionware-github
Copy link
Contributor

When you click the button in the notification, its possible that the event gets executed multiple times. Now the notification gets removed from the dictionary after the first execution of "OnNotifyActionInvoked" and will be null if the method runs again for the same command.

@onionware-github
Copy link
Contributor Author

Maybe also publish a new Nuget release?

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;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the notification is removed then checking TryGetValue here is enough. It already returns false when the item is not in the dictionary.

@pr8x pr8x added the bug Something isn't working label Jun 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants