Преглед изворни кода

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

Gildas пре 7 година
родитељ
комит
c48e69e5c5
1 измењених фајлова са 1 додато и 1 уклоњено
  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);