Browse Source

avoid tring re-downloading the file when the user cancels the download

Gildas 7 years ago
parent
commit
c48e69e5c5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      extension/core/bg/download.js

+ 1 - 1
extension/core/bg/download.js

@@ -64,7 +64,7 @@ singlefile.download = (() => {
 						resolve({});
 						browser.downloads.onChanged.removeListener(onChanged);
 					}
-					if (event.state.current == "interrupted") {
+					if (event.state.current == "interrupted" && (!event.error || event.error.current != "USER_CANCELED")) {
 						URL.revokeObjectURL(page.url);
 						reject(new Error(event.state.current));
 						browser.downloads.onChanged.removeListener(onChanged);