소스 검색

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);