mirror of
https://github.com/bitwarden/browser.git
synced 2025-02-12 00:41:29 +01:00
[PM-16932] Fix timeout when desktop app is not started (#12799)
* Fix biometrics button showing up when biometrics is not enabled * Fix tests * Fix timeout when desktop app is not started * Update comments for legacy biometrics removal
This commit is contained in:
parent
ffe05f27c4
commit
a54508a0e3
@ -257,7 +257,7 @@ export class NativeMessagingBackground {
|
|||||||
message.command == BiometricsCommands.Unlock ||
|
message.command == BiometricsCommands.Unlock ||
|
||||||
message.command == BiometricsCommands.IsAvailable
|
message.command == BiometricsCommands.IsAvailable
|
||||||
) {
|
) {
|
||||||
// TODO remove after 2025.01
|
// TODO remove after 2025.3
|
||||||
// wait until there is no other callbacks, or timeout
|
// wait until there is no other callbacks, or timeout
|
||||||
const call = await firstValueFrom(
|
const call = await firstValueFrom(
|
||||||
race(
|
race(
|
||||||
|
@ -54,7 +54,15 @@ export class ExtensionLockComponentService implements LockComponentService {
|
|||||||
if (!(await firstValueFrom(this.biometricStateService.biometricUnlockEnabled$))) {
|
if (!(await firstValueFrom(this.biometricStateService.biometricUnlockEnabled$))) {
|
||||||
return BiometricsStatus.NotEnabledLocally;
|
return BiometricsStatus.NotEnabledLocally;
|
||||||
} else {
|
} else {
|
||||||
return await this.biometricsService.getBiometricsStatusForUser(userId);
|
// TODO remove after 2025.3
|
||||||
|
// remove after backward compatibility code for old biometrics ipc protocol is removed
|
||||||
|
const result: BiometricsStatus = (await Promise.race([
|
||||||
|
this.biometricsService.getBiometricsStatusForUser(userId),
|
||||||
|
new Promise((resolve) =>
|
||||||
|
setTimeout(() => resolve(BiometricsStatus.DesktopDisconnected), 1000),
|
||||||
|
),
|
||||||
|
])) as BiometricsStatus;
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
this.userDecryptionOptionsService.userDecryptionOptionsById$(userId),
|
this.userDecryptionOptionsService.userDecryptionOptionsById$(userId),
|
||||||
|
@ -188,7 +188,7 @@ export class BiometricMessageHandlerService {
|
|||||||
appId,
|
appId,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// TODO: legacy, remove after 2025.01
|
// TODO: legacy, remove after 2025.3
|
||||||
case BiometricsCommands.IsAvailable: {
|
case BiometricsCommands.IsAvailable: {
|
||||||
const available =
|
const available =
|
||||||
(await this.biometricsService.getBiometricsStatus()) == BiometricsStatus.Available;
|
(await this.biometricsService.getBiometricsStatus()) == BiometricsStatus.Available;
|
||||||
@ -200,7 +200,7 @@ export class BiometricMessageHandlerService {
|
|||||||
appId,
|
appId,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// TODO: legacy, remove after 2025.01
|
// TODO: legacy, remove after 2025.3
|
||||||
case BiometricsCommands.Unlock: {
|
case BiometricsCommands.Unlock: {
|
||||||
const isTemporarilyDisabled =
|
const isTemporarilyDisabled =
|
||||||
(await this.biometricStateService.getBiometricUnlockEnabled(message.userId as UserId)) &&
|
(await this.biometricStateService.getBiometricUnlockEnabled(message.userId as UserId)) &&
|
||||||
|
Loading…
Reference in New Issue
Block a user