Expose 'pick-folder' method in main.js using IPC
This commit is contained in:
7
main.js
7
main.js
@@ -1104,7 +1104,12 @@ app.whenReady().then(() => {
|
|||||||
return folders.find(f => f.path === newPath);
|
return folders.find(f => f.path === newPath);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ipcMain.handle('pick-folder', async () => {
|
||||||
|
const result = await dialog.showOpenDialog({
|
||||||
|
properties: ['openDirectory']
|
||||||
|
});
|
||||||
|
return result.canceled ? null : result.filePaths;
|
||||||
|
});
|
||||||
|
|
||||||
// … Ende der IPC-Handler …
|
// … Ende der IPC-Handler …
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user