1
0
mirror of https://github.com/bitwarden/jslib synced 2025-12-23 19:53:55 +00:00

[bug] Ensure lock component is always working with the latest active account in state

This commit is contained in:
addison
2021-11-05 13:47:04 -04:00
parent b762e3a3d9
commit 3f1e84afa3

View File

@@ -47,17 +47,19 @@ export class LockComponent implements OnInit {
protected apiService: ApiService, private logService: LogService) { } protected apiService: ApiService, private logService: LogService) { }
async ngOnInit() { async ngOnInit() {
this.pinSet = await this.vaultTimeoutService.isPinLockSet(); this.stateService.accounts.subscribe(async _accounts => {
this.pinLock = (this.pinSet[0] && (await this.stateService.getEncryptedPinProtected()) != null) || this.pinSet[1]; this.pinSet = await this.vaultTimeoutService.isPinLockSet();
this.supportsBiometric = await this.platformUtilsService.supportsBiometric(); this.pinLock = (this.pinSet[0] && (await this.stateService.getEncryptedPinProtected()) != null) || this.pinSet[1];
this.biometricLock = await this.vaultTimeoutService.isBiometricLockSet() && this.supportsBiometric = await this.platformUtilsService.supportsBiometric();
(await this.cryptoService.hasKeyStored(KeySuffixOptions.Biometric) || !this.platformUtilsService.supportsSecureStorage()); this.biometricLock = await this.vaultTimeoutService.isBiometricLockSet() &&
this.biometricText = await this.stateService.getBiometricText(); (await this.cryptoService.hasKeyStored(KeySuffixOptions.Biometric) || !this.platformUtilsService.supportsSecureStorage());
this.email = await this.stateService.getEmail(); this.biometricText = await this.stateService.getBiometricText();
this.email = await this.stateService.getEmail();
const webVaultUrl = this.environmentService.getWebVaultUrl(); const webVaultUrl = this.environmentService.getWebVaultUrl();
const vaultUrl = webVaultUrl === 'https://vault.bitwarden.com' ? 'https://bitwarden.com' : webVaultUrl; const vaultUrl = webVaultUrl === 'https://vault.bitwarden.com' ? 'https://bitwarden.com' : webVaultUrl;
this.webVaultHostname = Utils.getHostname(vaultUrl); this.webVaultHostname = Utils.getHostname(vaultUrl);
});
} }
async submit() { async submit() {