diff --git a/main.js b/main.js index 20e1f96..b3c5d27 100644 --- a/main.js +++ b/main.js @@ -214,24 +214,28 @@ ipcMain.on("close-secondary", () => { secondaryWindow = null; }); -ipcMain.on("select-location", () => { - const location = dialog.showOpenDialogSync(secondaryWindow, { +ipcMain.on("select-location-main", () => { + const location = dialog.showOpenDialogSync({ properties: ["openDirectory"], }); if (location) { - if (secondaryWindow){ - secondaryWindow.webContents.send("downloadPath", location); - } - else{ - win.webContents.send("downloadPath", location); - } - + win.webContents.send("downloadPath", location); + } +}); + +ipcMain.on("select-location-secondary", () => { + const location = dialog.showOpenDialogSync({ + properties: ["openDirectory"], + }); + + if (location) { + secondaryWindow.webContents.send("downloadPath", location); } }); ipcMain.on("select-config", () => { - const location = dialog.showOpenDialogSync(secondaryWindow, { + const location = dialog.showOpenDialogSync( { properties: ["openFile"], }); @@ -240,10 +244,10 @@ ipcMain.on("select-config", () => { } }); -ipcMain.on("quit", ()=>{ +ipcMain.on("quit", () => { isQuiting = true; - app.quit() -}) + app.quit(); +}); // Auto update let autoUpdate = false; diff --git a/package.json b/package.json index e4eaba4..b1f352a 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "yt-dlp-wrap-plus": "^2.3.16" }, "name": "ytdownloader", - "version": "3.14.0", + "version": "3.14.1", "main": "main.js", "scripts": { "start": "electron .", diff --git a/src/preferences.js b/src/preferences.js index 55f762e..4a4d338 100644 --- a/src/preferences.js +++ b/src/preferences.js @@ -31,7 +31,7 @@ getId("back").addEventListener("click", () => { // Selecting download directory getId("selectLocation").addEventListener("click", () => { - ipcRenderer.send("select-location", ""); + ipcRenderer.send("select-location-secondary", ""); }); ipcRenderer.on("downloadPath", (event, downloadPath) => { diff --git a/src/renderer.js b/src/renderer.js index ec2c780..27dc776 100644 --- a/src/renderer.js +++ b/src/renderer.js @@ -1130,7 +1130,7 @@ ipcRenderer.on("link", (event, text) => { // Selecting download directory getId("selectLocation").addEventListener("click", () => { - ipcRenderer.send("select-location", ""); + ipcRenderer.send("select-location-main", ""); }); ipcRenderer.on("downloadPath", (event, downloadPath) => {