Update last used index when auto-fill worked correctly (#1425)

This commit is contained in:
Josep Marí 2020-10-09 13:31:02 +02:00 committed by GitHub
parent 2e20192f1b
commit c86151d74f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

2
jslib

@ -1 +1 @@
Subproject commit f30d6f8027055507abfdefd1eeb5d9aab25cc601 Subproject commit e371d737b0d3db99f195c3317ecf9eaa16bd19b3

View File

@ -234,7 +234,7 @@ export default class AutofillService implements AutofillServiceInterface {
cipher = await this.cipherService.getLastUsedForUrl(tab.url); cipher = await this.cipherService.getLastUsedForUrl(tab.url);
} }
return await this.doAutoFill({ const autoFillResponse = await this.doAutoFill({
cipher: cipher, cipher: cipher,
pageDetails: pageDetails, pageDetails: pageDetails,
skipTotp: !fromCommand, skipTotp: !fromCommand,
@ -244,6 +244,13 @@ export default class AutofillService implements AutofillServiceInterface {
onlyVisibleFields: !fromCommand, onlyVisibleFields: !fromCommand,
fillNewPassword: fromCommand, fillNewPassword: fromCommand,
}); });
// Only update last used index if doAutoFill didn't throw an exception
if (fromCommand) {
this.cipherService.updateLastUsedIndexForUrl(tab.url);
}
return autoFillResponse;
} }
// Helpers // Helpers