From f1d93b673f76bdf2d1891e33bca69a5c23ce0e99 Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Fri, 10 Jan 2025 13:43:29 +0100 Subject: [PATCH] Fix timeout when desktop app is not started --- .../lock/services/extension-lock-component.service.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/browser/src/key-management/lock/services/extension-lock-component.service.ts b/apps/browser/src/key-management/lock/services/extension-lock-component.service.ts index 77c0fcaf50a..75001ac5b62 100644 --- a/apps/browser/src/key-management/lock/services/extension-lock-component.service.ts +++ b/apps/browser/src/key-management/lock/services/extension-lock-component.service.ts @@ -54,7 +54,14 @@ export class ExtensionLockComponentService implements LockComponentService { if (!(await firstValueFrom(this.biometricStateService.biometricUnlockEnabled$))) { return BiometricsStatus.NotEnabledLocally; } else { - return await this.biometricsService.getBiometricsStatusForUser(userId); + // 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),