mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 14:53:33 +00:00
dont init history
This commit is contained in:
@@ -148,7 +148,7 @@ export class PasswordGenerationService implements PasswordGenerationServiceAbstr
|
|||||||
}
|
}
|
||||||
|
|
||||||
private optionsCache: any;
|
private optionsCache: any;
|
||||||
private history: PasswordHistory[] = [];
|
private history: PasswordHistory[];
|
||||||
|
|
||||||
constructor(private cryptoService: CryptoService, private storageService: StorageService) {
|
constructor(private cryptoService: CryptoService, private storageService: StorageService) {
|
||||||
}
|
}
|
||||||
@@ -203,11 +203,11 @@ export class PasswordGenerationService implements PasswordGenerationServiceAbstr
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
currentHistory.push(new PasswordHistory(password, Date.now()));
|
currentHistory.unshift(new PasswordHistory(password, Date.now()));
|
||||||
|
|
||||||
// Remove old items.
|
// Remove old items.
|
||||||
if (currentHistory.length > MaxPasswordsInHistory) {
|
if (currentHistory.length > MaxPasswordsInHistory) {
|
||||||
currentHistory.shift();
|
currentHistory.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
const newHistory = await this.encryptHistory(currentHistory);
|
const newHistory = await this.encryptHistory(currentHistory);
|
||||||
|
|||||||
Reference in New Issue
Block a user