diff --git a/jslib b/jslib index f30d6f8027..e371d737b0 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit f30d6f8027055507abfdefd1eeb5d9aab25cc601 +Subproject commit e371d737b0d3db99f195c3317ecf9eaa16bd19b3 diff --git a/src/services/autofill.service.ts b/src/services/autofill.service.ts index 10b90216c1..250d8619fb 100644 --- a/src/services/autofill.service.ts +++ b/src/services/autofill.service.ts @@ -234,7 +234,7 @@ export default class AutofillService implements AutofillServiceInterface { cipher = await this.cipherService.getLastUsedForUrl(tab.url); } - return await this.doAutoFill({ + const autoFillResponse = await this.doAutoFill({ cipher: cipher, pageDetails: pageDetails, skipTotp: !fromCommand, @@ -244,6 +244,13 @@ export default class AutofillService implements AutofillServiceInterface { onlyVisibleFields: !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