fix: using correct deserialization type instead JsonElement for everyting except mixed arrays

This commit is contained in:
Denny09310
2025-11-09 15:46:33 +01:00
parent 168eceac8c
commit 0522bc425b
20 changed files with 191 additions and 242 deletions

View File

@@ -50,11 +50,10 @@ namespace ElectronNET.API
var taskCompletionSource = new TaskCompletionSource<string[]>();
var guid = Guid.NewGuid().ToString();
BridgeConnector.Socket.On<JsonElement>("showOpenDialogComplete" + guid, (filePaths) =>
BridgeConnector.Socket.On<string[]>("showOpenDialogComplete" + guid, (filePaths) =>
{
BridgeConnector.Socket.Off("showOpenDialogComplete" + guid);
var result = filePaths.Deserialize<string[]>(ElectronJson.Options);
taskCompletionSource.SetResult(result);
taskCompletionSource.SetResult(filePaths);
});
@@ -76,11 +75,10 @@ namespace ElectronNET.API
var taskCompletionSource = new TaskCompletionSource<string>();
var guid = Guid.NewGuid().ToString();
BridgeConnector.Socket.On<JsonElement>("showSaveDialogComplete" + guid, (filename) =>
BridgeConnector.Socket.On<string>("showSaveDialogComplete" + guid, (filename) =>
{
BridgeConnector.Socket.Off("showSaveDialogComplete" + guid);
taskCompletionSource.SetResult(filename.GetString());
taskCompletionSource.SetResult(filename);
});
BridgeConnector.Socket.Emit("showSaveDialog",