1
0
mirror of https://github.com/bitwarden/jslib synced 2025-12-21 10:43:23 +00:00

[review] [refactor] Extract lock refresh logic to a load function

This commit is contained in:
addison
2021-11-11 11:58:41 -05:00
parent b095f7fcce
commit 00affbad36

View File

@@ -50,6 +50,11 @@ export class LockComponent implements OnInit {
async ngOnInit() {
this.stateService.accounts.subscribe(async _accounts => {
await this.load();
});
}
private async load() {
this.pinSet = await this.vaultTimeoutService.isPinLockSet();
this.pinLock = (this.pinSet[0] && (await this.stateService.getEncryptedPinProtected()) != null) || this.pinSet[1];
this.supportsBiometric = await this.platformUtilsService.supportsBiometric();
@@ -66,7 +71,6 @@ export class LockComponent implements OnInit {
const webVaultUrl = this.environmentService.getWebVaultUrl();
const vaultUrl = webVaultUrl === 'https://vault.bitwarden.com' ? 'https://bitwarden.com' : webVaultUrl;
this.webVaultHostname = Utils.getHostname(vaultUrl);
});
}
async submit() {