From 23562d9bee2f5b487d5201578e19da18281e3c20 Mon Sep 17 00:00:00 2001 From: Quang Lam Date: Sun, 10 May 2020 15:17:17 +0700 Subject: [PATCH] Fix download path preference is not respected in save dialog (#247) --- public/libs/views.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/public/libs/views.js b/public/libs/views.js index a02fae21..5c476ccd 100644 --- a/public/libs/views.js +++ b/public/libs/views.js @@ -451,6 +451,13 @@ const addView = (browserWindow, workspace) => { // eslint-disable-next-line no-param-reassign item.savePath = finalFilePath; } + } else { + // set preferred path for save dialog + const opts = { + ...item.getSaveDialogOptions(), + defaultPath: path.join(downloadPath, item.getFilename()), + }; + item.setSaveDialogOptions(opts); } });