1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 14:53:33 +00:00

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
2 changed files with 9 additions and 2 deletions

2
jslib

Submodule jslib updated: f30d6f8027...e371d737b0

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