Skip to content

Commit

Permalink
Bug 949395 - [Download Manager] Downloading progress bar is not displ…
Browse files Browse the repository at this point in the history
…ayed after restart a stopped download
  • Loading branch information
crdlc committed Dec 20, 2013
1 parent 259b94d commit 7a408ae
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions apps/settings/js/downloads/downloads_list.js
Expand Up @@ -164,8 +164,8 @@
request.onconfirm = function() {
if (download.pause) {
download.pause().then(function() {
// Remove listener
download.onstatechange = null;
// We don't remove the listener because the download could be
// restarted in notification tray
_update(download);
}, function() {
console.error('Could not pause the download');
Expand All @@ -178,17 +178,14 @@
function _restartDownload(download) {
var request = DownloadUI.show(DownloadUI.TYPE.STOPPED, download);

function checkDownload() {
download.onstatechange = _onDownloadStateChange;
_update(download);
}

request.onconfirm = function() {
if (download.resume) {
download.resume().then(function() {
checkDownload();
// Nothing to do here -> this resolves only once the download has
// succeeded.
}, function onError() {
alert(navigator.mozL10n.get('restart_download_error'));
// This error is fired when a download restarted is paused
console.error(navigator.mozL10n.get('restart_download_error'));
});
}
};
Expand Down

0 comments on commit 7a408ae

Please sign in to comment.