mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 01:33:33 +00:00
Add login launch data (#174)
* added launch time data to CipherView for autofill * removed unused code * fixed linter errors
This commit is contained in:
@@ -23,6 +23,10 @@ export class SortedCiphersCache {
|
||||
return this.isCached(url) ? this.sortedCiphersByUrl.get(url).getLastUsed() : null;
|
||||
}
|
||||
|
||||
getLastLaunched(url: string) {
|
||||
return this.isCached(url) ? this.sortedCiphersByUrl.get(url).getLastLaunched() : null;
|
||||
}
|
||||
|
||||
getNext(url: string) {
|
||||
this.resetTimer(url);
|
||||
return this.isCached(url) ? this.sortedCiphersByUrl.get(url).getNext() : null;
|
||||
@@ -52,6 +56,11 @@ class Ciphers {
|
||||
return this.ciphers[this.lastUsedIndex];
|
||||
}
|
||||
|
||||
getLastLaunched() {
|
||||
const sortedCiphers = this.ciphers.sort((x, y) => y.localData?.lastLaunched?.valueOf() - x.localData?.lastLaunched?.valueOf());
|
||||
return sortedCiphers[0];
|
||||
}
|
||||
|
||||
getNext() {
|
||||
const nextIndex = (this.lastUsedIndex + 1) % this.ciphers.length;
|
||||
this.lastUsedIndex = nextIndex;
|
||||
|
||||
Reference in New Issue
Block a user