Fix download path preference is not respected in save dialog (#247)

This commit is contained in:
Quang Lam 2020-05-10 15:17:17 +07:00 committed by GitHub
parent 317bfab65a
commit 23562d9bee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}
});