mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 00:03:56 +00:00
implement hasKey helper
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user