Skip to content

Commit fabd25a

Browse files
2 parents 029b077 + a03dc1d commit fabd25a

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

ElectronNET.API/Shell.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,22 @@ public Task<bool> ShowItemInFolderAsync(string fullPath)
5959
}
6060

6161
/// <summary>
62-
/// Open the given file in the desktops default manner.
62+
/// Open the given file in the desktop's default manner.
6363
/// </summary>
64-
/// <param name="fullPath"></param>
65-
/// <returns>Whether the item was successfully opened.</returns>
66-
public Task<bool> OpenPathAsync(string fullPath)
64+
/// <param name="path">The path to the file.</param>
65+
/// <returns>The error message corresponding to the failure if a failure occurred, otherwise <see cref="string.Empty"/>.</returns>
66+
public Task<string> OpenPathAsync(string path)
6767
{
68-
var taskCompletionSource = new TaskCompletionSource<bool>();
68+
var taskCompletionSource = new TaskCompletionSource<string>();
6969

7070
BridgeConnector.Socket.On("shell-openPathCompleted", (success) =>
7171
{
7272
BridgeConnector.Socket.Off("shell-openPathCompleted");
7373

74-
taskCompletionSource.SetResult((bool)success);
74+
taskCompletionSource.SetResult((string) success);
7575
});
7676

77-
BridgeConnector.Socket.Emit("shell-openPath", fullPath);
77+
BridgeConnector.Socket.Emit("shell-openPath", path);
7878

7979
return taskCompletionSource.Task;
8080
}

ElectronNET.Host/api/shell.js

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

ElectronNET.Host/api/shell.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ElectronNET.Host/api/shell.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ export = (socket: SocketIO.Socket) => {
99
electronSocket.emit('shell-showItemInFolderCompleted', success);
1010
});
1111

12-
socket.on('shell-openPath', async (fullPath) => {
13-
const success = await shell.openPath(fullPath);
12+
socket.on('shell-openPath', async (path) => {
13+
const errorMessage = await shell.openPath(path);
1414

15-
electronSocket.emit('shell-openPathCompleted', success);
16-
});
15+
electronSocket.emit('shell-openPathCompleted', errorMessage);
16+
})
1717

1818
socket.on('shell-openExternal', (url, options) => {
1919
let success = true;

0 commit comments

Comments
 (0)