mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 06:13:38 +00:00
[PM-8225] Implement periodic biometric readiness check in lock component (#9976)
* Remove old biometrics masterkey logic * Move shared ipc keys to main process * Allow browser extension unlock while desktop is locked * Dynamicall detect biometrics on desktop lock screen
This commit is contained in:
@@ -40,6 +40,7 @@ export class LockComponent extends BaseLockComponent {
|
|||||||
protected biometricReady = false;
|
protected biometricReady = false;
|
||||||
private biometricAsked = false;
|
private biometricAsked = false;
|
||||||
private autoPromptBiometric = false;
|
private autoPromptBiometric = false;
|
||||||
|
private timerId: any;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
masterPasswordService: InternalMasterPasswordServiceAbstraction,
|
masterPasswordService: InternalMasterPasswordServiceAbstraction,
|
||||||
@@ -135,11 +136,18 @@ export class LockComponent extends BaseLockComponent {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
this.messagingService.send("getWindowIsFocused");
|
this.messagingService.send("getWindowIsFocused");
|
||||||
|
|
||||||
|
// start background listener until destroyed on interval
|
||||||
|
this.timerId = setInterval(async () => {
|
||||||
|
this.supportsBiometric = await this.platformUtilsService.supportsBiometric();
|
||||||
|
this.biometricReady = await this.canUseBiometric();
|
||||||
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
super.ngOnDestroy();
|
super.ngOnDestroy();
|
||||||
this.broadcasterService.unsubscribe(BroadcasterSubscriptionId);
|
this.broadcasterService.unsubscribe(BroadcasterSubscriptionId);
|
||||||
|
clearInterval(this.timerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
onWindowHidden() {
|
onWindowHidden() {
|
||||||
|
|||||||
Reference in New Issue
Block a user