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