Просмотр исходного кода

renamed parameters

Former-commit-id: 1c263b18e5e11f53e935751cc9e4a9643b4174d7
Gildas 6 лет назад
Родитель
Сommit
a29122d2e3
1 измененных файлов с 7 добавлено и 7 удалено
  1. 7 7
      extension/core/bg/downloads.js

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

@@ -125,12 +125,12 @@ singlefile.extension.core.bg.downloads = (() => {
 		}
 		}
 	}
 	}
 
 
-	async function getAuthInfo(uploadOptions, force) {
+	async function getAuthInfo(authOptions, force) {
 		let authInfo = await singlefile.extension.core.bg.config.getAuthInfo();
 		let authInfo = await singlefile.extension.core.bg.config.getAuthInfo();
 		const options = {
 		const options = {
 			interactive: true,
 			interactive: true,
-			auto: uploadOptions.extractAuthCode,
-			forceWebAuthFlow: uploadOptions.forceWebAuthFlow,
+			auto: authOptions.extractAuthCode,
+			forceWebAuthFlow: authOptions.forceWebAuthFlow,
 			requestPermissionIdentity,
 			requestPermissionIdentity,
 			launchWebAuthFlow: options => singlefile.extension.core.bg.tabs.launchWebAuthFlow(options),
 			launchWebAuthFlow: options => singlefile.extension.core.bg.tabs.launchWebAuthFlow(options),
 			extractAuthCode: authURL => singlefile.extension.core.bg.tabs.extractAuthCode(authURL),
 			extractAuthCode: authURL => singlefile.extension.core.bg.tabs.extractAuthCode(authURL),
@@ -148,9 +148,9 @@ singlefile.extension.core.bg.downloads = (() => {
 		return authInfo;
 		return authInfo;
 	}
 	}
 
 
-	async function uploadPage(filename, blob, tabId, options) {
+	async function uploadPage(filename, blob, tabId, authOptions) {
 		try {
 		try {
-			await getAuthInfo(options);
+			await getAuthInfo(authOptions);
 			await gDrive.upload(filename, blob);
 			await gDrive.upload(filename, blob);
 		}
 		}
 		catch (error) {
 		catch (error) {
@@ -160,7 +160,7 @@ singlefile.extension.core.bg.downloads = (() => {
 					authInfo = await gDrive.refreshAuthToken();
 					authInfo = await gDrive.refreshAuthToken();
 				} catch (error) {
 				} catch (error) {
 					if (error.message == "unknown_token") {
 					if (error.message == "unknown_token") {
-						authInfo = await getAuthInfo(options, true);
+						authInfo = await getAuthInfo(authOptions, true);
 					} else {
 					} else {
 						throw error;
 						throw error;
 					}
 					}
@@ -170,7 +170,7 @@ singlefile.extension.core.bg.downloads = (() => {
 				} else {
 				} else {
 					await singlefile.extension.core.bg.config.removeAuthInfo();
 					await singlefile.extension.core.bg.config.removeAuthInfo();
 				}
 				}
-				await uploadPage(filename, blob, tabId, options);
+				await uploadPage(filename, blob, tabId, authOptions);
 			} else {
 			} else {
 				throw error;
 				throw error;
 			}
 			}