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

implement hasKey helper

This commit is contained in:
Kyle Spearrin
2018-06-13 17:14:26 -04:00
parent eda99e4f12
commit 3303e60b40
7 changed files with 18 additions and 16 deletions

View File

@@ -169,7 +169,7 @@ export class PasswordGenerationService implements PasswordGenerationServiceAbstr
}
async getHistory(): Promise<PasswordHistory[]> {
const hasKey = (await this.cryptoService.getKey()) != null;
const hasKey = await this.cryptoService.hasKey();
if (!hasKey) {
return new Array<PasswordHistory>();
}
@@ -184,7 +184,7 @@ export class PasswordGenerationService implements PasswordGenerationServiceAbstr
async addHistory(password: string): Promise<any> {
// Cannot add new history if no key is available
const hasKey = (await this.cryptoService.getKey()) != null;
const hasKey = await this.cryptoService.hasKey();
if (!hasKey) {
return;
}