Ver Fonte

moved code

Former-commit-id: 2633fbff325bd180cb5ebd31e2f136ec9e3a7426
Gildas há 6 anos atrás
pai
commit
4dba2b83f5

+ 4 - 4
extension/core/bg/business.js

@@ -59,10 +59,7 @@ singlefile.extension.core.bg.business = (() => {
 				saveInfo.cancel = cancelCallback;
 			}
 		},
-		onSaveEnd: (tabId, autoClose) => {
-			if (autoClose) {
-				singlefile.extension.core.bg.tabs.remove(tabId);
-			}
+		onSaveEnd: tabId => {
 			const saveInfo = currentSaves.get(tabId);
 			if (saveInfo) {
 				saveInfo.resolve();
@@ -108,6 +105,9 @@ singlefile.extension.core.bg.business = (() => {
 					}
 					saveTabs(tabs, options);
 					await promiseSaveTab;
+					if (tabOptions.autoClose) {
+						singlefile.extension.core.bg.tabs.remove(tabId);
+					}
 				}
 			} catch (error) {
 				if (error && (!error.message || (error.message != ERROR_CONNECTION_LOST_CHROMIUM && error.message != ERROR_CONNECTION_ERROR_CHROMIUM && error.message != ERROR_CONNECTION_LOST_GECKO))) {

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

@@ -60,7 +60,7 @@ singlefile.extension.core.bg.downloads = (() => {
 			return {};
 		}
 		if (message.method.endsWith(".end")) {
-			singlefile.extension.core.bg.business.onSaveEnd(sender.tab.id, message.autoClose);
+			singlefile.extension.core.bg.business.onSaveEnd(sender.tab.id);
 			return {};
 		}
 		if (message.method.endsWith(".getInfo")) {

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

@@ -68,7 +68,7 @@ this.singlefile.extension.core.content.download = this.singlefile.extension.core
 			}
 			browser.runtime.sendMessage({ method: "ui.processEnd" });
 		}
-		await browser.runtime.sendMessage({ method: "downloads.end", autoClose: options.autoClose });
+		await browser.runtime.sendMessage({ method: "downloads.end" });
 	}
 
 	function downloadPageForeground(pageData) {