mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-07-14 20:56:45 +00:00
fix: using correct deserialization type instead JsonElement for everyting except mixed arrays
This commit is contained in:
@@ -53,9 +53,9 @@ namespace ElectronNET.API
|
||||
_shortcuts.Add(accelerator, function);
|
||||
|
||||
BridgeConnector.Socket.Off("globalShortcut-pressed");
|
||||
BridgeConnector.Socket.On<JsonElement>("globalShortcut-pressed", (shortcut) =>
|
||||
BridgeConnector.Socket.On<string>("globalShortcut-pressed", (shortcut) =>
|
||||
{
|
||||
if (_shortcuts.TryGetValue(shortcut.GetString(), out var action))
|
||||
if (_shortcuts.TryGetValue(shortcut, out var action))
|
||||
{
|
||||
action();
|
||||
}
|
||||
@@ -75,11 +75,11 @@ namespace ElectronNET.API
|
||||
{
|
||||
var taskCompletionSource = new TaskCompletionSource<bool>();
|
||||
|
||||
BridgeConnector.Socket.On<JsonElement>("globalShortcut-isRegisteredCompleted", (isRegistered) =>
|
||||
BridgeConnector.Socket.On<bool>("globalShortcut-isRegisteredCompleted", (isRegistered) =>
|
||||
{
|
||||
BridgeConnector.Socket.Off("globalShortcut-isRegisteredCompleted");
|
||||
|
||||
taskCompletionSource.SetResult(isRegistered.GetBoolean());
|
||||
taskCompletionSource.SetResult(isRegistered);
|
||||
});
|
||||
|
||||
BridgeConnector.Socket.Emit("globalShortcut-isRegistered", accelerator);
|
||||
|
||||
Reference in New Issue
Block a user