We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e374a0 commit 9939f1aCopy full SHA for 9939f1a
src/index.ts
@@ -614,13 +614,16 @@ const ipcHandler = <A, R>(fn: (...args: A[]) => R) => (
614
}
615
};
616
617
-ipcMain.handle('select-application', ipcHandler(() => {
618
- return dialog.showOpenDialogSync({
+ipcMain.handle('select-application', ipcHandler(async () => {
+ const result = await dialog.showOpenDialog({
619
properties:
620
process.platform === 'darwin'
621
? ['openFile', 'openDirectory', 'treatPackageAsDirectory']
622
: ['openFile'],
623
- })?.[0];
+ });
624
+
625
+ if (!result || result.canceled) return undefined;
626
+ else return result.filePaths[0];
627
}));
628
629
// Enable the default context menu
0 commit comments