1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-27 12:36:14 +01:00

dont init history

This commit is contained in:
Kyle Spearrin 2018-02-17 22:51:28 -05:00
parent acb7b7b8e3
commit 80cd30d7d8

View File

@ -148,7 +148,7 @@ export class PasswordGenerationService implements PasswordGenerationServiceAbstr
}
private optionsCache: any;
private history: PasswordHistory[] = [];
private history: PasswordHistory[];
constructor(private cryptoService: CryptoService, private storageService: StorageService) {
}
@ -203,11 +203,11 @@ export class PasswordGenerationService implements PasswordGenerationServiceAbstr
return;
}
currentHistory.push(new PasswordHistory(password, Date.now()));
currentHistory.unshift(new PasswordHistory(password, Date.now()));
// Remove old items.
if (currentHistory.length > MaxPasswordsInHistory) {
currentHistory.shift();
currentHistory.pop();
}
const newHistory = await this.encryptHistory(currentHistory);