Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Implement app.dock.downloadFinished #8418

Merged
merged 1 commit into from
Apr 26, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/browser/electronDownloadItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */

const downloadStates = require('../../js/constants/downloadStates')
const electron = require('electron')
const app = electron.app

/**
* Maps downloadId to an electron download-item
Expand All @@ -11,6 +13,9 @@ const downloadMap = {}

module.exports.updateElectronDownloadItem = (downloadId, item, state) => {
if (state === downloadStates.INTERRUPTED || state === downloadStates.CANCELLED || state === downloadStates.COMPLETED) {
if (state === downloadStates.COMPLETED) {
app.dock.downloadFinished(item.getSavePath())
}
delete downloadMap[downloadId]
} else {
downloadMap[downloadId] = item
Expand Down