From ce9f87cfe297243edf83dd0398efe3ca39efc7ad Mon Sep 17 00:00:00 2001 From: Timothy Le Bon Date: Tue, 20 Feb 2024 16:45:48 +0100 Subject: [PATCH] runfix: issue with disabling downloadpath --- electron/src/main.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/electron/src/main.ts b/electron/src/main.ts index b8651aad166..7cfe0f573e6 100644 --- a/electron/src/main.ts +++ b/electron/src/main.ts @@ -212,8 +212,10 @@ const bindIpcEvents = (): void => { ipcMain.handle(EVENT_TYPE.ACTION.GET_OG_DATA, (_event, url) => getOpenGraphDataAsync(url)); ipcMain.on(EVENT_TYPE.ACTION.CHANGE_DOWNLOAD_LOCATION, (_event, downloadPath?: string) => { - if (downloadPath && EnvironmentUtil.platform.IS_WINDOWS) { - fs.ensureDirSync(appHomePath(downloadPath)); + if (EnvironmentUtil.platform.IS_WINDOWS) { + if (downloadPath) { + fs.ensureDirSync(appHomePath(downloadPath)); + } //save the downloadPath locally settings.save(SettingsType.DOWNLOAD_PATH, downloadPath); settings.persistToFile();