1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 16:23:44 +00:00

New method to update the last used index (#184)

Instead of updating it every time you call getNext(), it will be updated in a separate call, to avoid updating the index when the cipher did not auto-fill correctly (e.g wrong frame)
Fixes #1392
This commit is contained in:
Josep Marí
2020-10-09 13:30:55 +02:00
committed by GitHub
parent 9216a8ead7
commit 685636b129
3 changed files with 22 additions and 7 deletions

View File

@@ -456,6 +456,10 @@ export class CipherService implements CipherServiceAbstraction {
return this.getCipherForUrl(url, false, false);
}
updateLastUsedIndexForUrl(url: string) {
this.sortedCiphersCache.updateLastUsedIndex(url);
}
async updateLastUsedDate(id: string): Promise<void> {
let ciphersLocalData = await this.storageService.get<any>(Keys.localData);
if (!ciphersLocalData) {
@@ -1055,8 +1059,7 @@ export class CipherService implements CipherServiceAbstraction {
return this.sortedCiphersCache.getLastLaunched(url);
} else if (lastUsed) {
return this.sortedCiphersCache.getLastUsed(url);
}
else {
} else {
return this.sortedCiphersCache.getNext(url);
}
}