Skip to content

Commit 65399c2

Browse files
Merge pull request #95 from mojinxun/master
fix: socket.connnect JS : Scope & Closures
2 parents 5a676cb + 85127be commit 65399c2

File tree

17 files changed

+336
-226
lines changed

17 files changed

+336
-226
lines changed

ElectronNET.API/Dialog.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
using Newtonsoft.Json.Linq;
44
using Newtonsoft.Json.Serialization;
55
using System;
6+
using System.Collections.Generic;
67
using System.Threading.Tasks;
8+
using System.Web;
79

810
namespace ElectronNET.API
911
{
@@ -54,7 +56,12 @@ public Task<string[]> ShowOpenDialogAsync(BrowserWindow browserWindow, OpenDialo
5456
BridgeConnector.Socket.Off("showOpenDialogComplete" + guid);
5557

5658
var result = ((JArray)filePaths).ToObject<string[]>();
57-
taskCompletionSource.SetResult(result);
59+
var list = new List<string>();
60+
foreach (var item in result)
61+
{
62+
list.Add(HttpUtility.UrlDecode(item));
63+
}
64+
taskCompletionSource.SetResult(list.ToArray());
5865
});
5966

6067

ElectronNET.API/ElectronNET.API.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ This package contains the API to access the "native" electron API.</Description>
1616
<PackageTags>electron aspnetcore</PackageTags>
1717
<PackageReleaseNotes>Changelog: https://github.com/ElectronNET/Electron.NET/blob/master/Changelog.md</PackageReleaseNotes>
1818
<PackageIconUrl>https://raw.githubusercontent.com/ElectronNET/Electron.NET/master/assets/images/electron.net-logo-square.png</PackageIconUrl>
19+
<Version>1.0.0.2</Version>
1920
</PropertyGroup>
2021

2122
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -31,8 +32,9 @@ This package contains the API to access the "native" electron API.</Description>
3132
</PropertyGroup>
3233

3334
<ItemGroup>
35+
<PackageReference Include="EngineIoClientDotNet" Version="1.0.7.2" />
3436
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.0.0" />
35-
<PackageReference Include="SocketIoClientDotNet" Version="1.0.3" />
37+
<PackageReference Include="SocketIoClientDotNet" Version="1.0.7.2" />
3638
</ItemGroup>
3739

3840
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(OS)' == 'Windows_NT'">

ElectronNET.API/IpcMain.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ internal static IpcMain Instance
4646
public void On(string channel, Action<object> listener)
4747
{
4848
BridgeConnector.Socket.Emit("registerIpcMainChannel", channel);
49+
BridgeConnector.Socket.Off(channel);
4950
BridgeConnector.Socket.On(channel, (args) =>
5051
{
5152
List<object> objectArray = FormatArguments(args);

ElectronNET.CLI/ElectronNET.CLI.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1010
<PackageOutputPath>..\artifacts</PackageOutputPath>
1111
<PackageId>ElectronNET.CLI</PackageId>
12-
<Version>1.0.0</Version>
12+
<Version>1.0.4.2</Version>
1313
<Authors>Gregor Biswanger, Robert Muehsig</Authors>
1414
<Product>Electron.NET</Product>
1515
<Company />

ElectronNET.Host/api/app.js

Lines changed: 34 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)