fix handle null select dir

This commit is contained in:
Abhinav 2022-09-06 17:49:04 +05:30
parent 403e460b44
commit 556ac94c4b

View file

@ -23,12 +23,9 @@ export default function setupIpcComs(
const result = await dialog.showOpenDialog({
properties: ['openDirectory'],
});
let dir =
result.filePaths &&
result.filePaths.length > 0 &&
result.filePaths[0];
dir = dir?.split(path.sep)?.join(path.posix.sep);
return dir;
if (result.filePaths && result.filePaths.length > 0) {
return result.filePaths[0]?.split(path.sep)?.join(path.posix.sep);
}
});
ipcMain.on('update-tray', (_, args) => {