mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-18 11:05:41 +01:00
use hasKey helper
This commit is contained in:
parent
010188545e
commit
2cbb7788f4
@ -210,12 +210,12 @@ export default class MainBackground {
|
||||
}
|
||||
|
||||
const isAuthenticated = await this.userService.isAuthenticated();
|
||||
const key = await this.cryptoService.getKey();
|
||||
const hasKey = await this.cryptoService.hasKey();
|
||||
|
||||
let suffix = '';
|
||||
if (!isAuthenticated) {
|
||||
suffix = '_gray';
|
||||
} else if (!key) {
|
||||
} else if (!hasKey) {
|
||||
suffix = '_locked';
|
||||
}
|
||||
|
||||
|
@ -24,8 +24,8 @@ export class LaunchGuardService implements CanActivate {
|
||||
return true;
|
||||
}
|
||||
|
||||
const key = await this.cryptoService.getKey();
|
||||
if (key == null) {
|
||||
const hasKey = await this.cryptoService.hasKey();
|
||||
if (!hasKey) {
|
||||
this.router.navigate(['lock']);
|
||||
} else {
|
||||
this.router.navigate(['tabs/current']);
|
||||
|
Loading…
Reference in New Issue
Block a user