We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a2479bf commit 6b94cc6Copy full SHA for 6b94cc6
src/ElectronNET.API/API/Notification.cs
@@ -97,7 +97,14 @@ private static void GenerateIDsForDefinedActions(NotificationOptions notificatio
97
isActionDefined = true;
98
99
BridgeConnector.Socket.Off("NotificationEventAction");
100
- BridgeConnector.Socket.On<string[]>("NotificationEventAction", (args) => { _notificationOptions.Single(x => x.ActionID == args[0]).OnAction(args[1]); });
+ BridgeConnector.Socket.On<string[]>("NotificationEventAction", (args) =>
101
+ {
102
+ var opt = _notificationOptions.Single(x => x.ActionID == args[0]);
103
+ if (int.TryParse(args[1], out var index))
104
105
+ opt.OnAction(index);
106
+ }
107
+ });
108
}
109
110
if (isActionDefined)
0 commit comments