Location selection error fixed for Windows

pull/164/head
Andrew 3 years ago
parent 88f38177d7
commit c394d1329a

@ -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);
}
});
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"],
});
@ -242,8 +246,8 @@ ipcMain.on("select-config", () => {
ipcMain.on("quit", () => {
isQuiting = true;
app.quit()
})
app.quit();
});
// Auto update
let autoUpdate = false;

@ -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 .",

@ -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) => {

@ -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) => {

Loading…
Cancel
Save