Skip to content

Commit

Permalink
Use the correct path (#149)
Browse files Browse the repository at this point in the history
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
  • Loading branch information
declanchiu and sindresorhus authored Apr 8, 2022
1 parent 14bb34f commit f1a1af1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,18 +157,20 @@ function registerListener(session, options, callback = () => {}) {
const message = pupa(errorMessage, {filename: path.basename(filePath)});
callback(new Error(message));
} else if (state === 'completed') {
const savePath = item.getSavePath();

if (process.platform === 'darwin') {
app.dock.downloadFinished(filePath);
app.dock.downloadFinished(savePath);
}

if (options.openFolderWhenDone) {
shell.showItemInFolder(filePath);
shell.showItemInFolder(savePath);
}

if (typeof options.onCompleted === 'function') {
options.onCompleted({
fileName: item.getFilename(),
path: item.getSavePath(),
path: savePath,
fileSize: item.getReceivedBytes(),
mimeType: item.getMimeType(),
url: item.getURL()
Expand Down

0 comments on commit f1a1af1

Please sign in to comment.