[ref] Improved readability for #1441

This commit is contained in:
wusatosi 2021-01-03 00:32:22 +08:00 committed by GitHub
parent 74a9ff7992
commit 8d2b84cbb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -254,7 +254,7 @@ export default class AutofillService implements AutofillServiceInterface {
} }
} }
const autoFillResponse = await this.doAutoFill({ const totpCode = await this.doAutoFill({
cipher: cipher, cipher: cipher,
pageDetails: pageDetails, pageDetails: pageDetails,
skipTotp: !fromCommand, skipTotp: !fromCommand,
@ -265,12 +265,12 @@ export default class AutofillService implements AutofillServiceInterface {
fillNewPassword: fromCommand, fillNewPassword: fromCommand,
}); });
// Only update last used index if doAutoFill didn't throw an exception // Update last used index as autofill has succeed
if (fromCommand) { if (fromCommand) {
this.cipherService.updateLastUsedIndexForUrl(tab.url); this.cipherService.updateLastUsedIndexForUrl(tab.url);
} }
return autoFillResponse; return totpCode;
} }
// Helpers // Helpers