Skip to content

Commit

Permalink
[MS] Updated how files are opened (#9682)
Browse files Browse the repository at this point in the history
  • Loading branch information
Max-7 authored Feb 13, 2025
1 parent fab8687 commit a8f1f46
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client/electron/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ ipcMain.on(PageToWindowChannel.CloseApp, async (_event) => {
});

ipcMain.on(PageToWindowChannel.OpenFile, async (_event, path: string) => {
const result = await shell.openPath(path);
if (result !== '') {
myCapacitorApp.sendEvent(WindowToPageChannel.OpenPathFailed, path, result);
if (!path.startsWith('file://')) {
path = `file://${path}`;
}
await shell.openExternal(path);
});

ipcMain.on(PageToWindowChannel.SeeInExplorer, async (_event, path: string) => {
Expand Down Expand Up @@ -213,7 +213,7 @@ ipcMain.on(PageToWindowChannel.PageIsInitialized, async () => {
});

ipcMain.on(PageToWindowChannel.OpenConfigDir, async () => {
await shell.openPath(parsecConfigDir);
await shell.openExternal(parsecConfigDir.startsWith('file://') ? parsecConfigDir : `file://${parsecConfigDir}`);
});

ipcMain.on(PageToWindowChannel.AuthorizeURL, async (_event, url: string) => {
Expand Down

0 comments on commit a8f1f46

Please sign in to comment.