From 37735436d1826f88e340e50d2fc048c211f0a846 Mon Sep 17 00:00:00 2001 From: Matt Gibson Date: Thu, 28 Mar 2024 06:53:20 -0500 Subject: [PATCH] Move biometric texts all to getters (#8520) We cannot load biometric text on init because they are not valid everywhere. This was causing issues with settings storage on linux. --- .../src/app/accounts/settings.component.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/apps/desktop/src/app/accounts/settings.component.ts b/apps/desktop/src/app/accounts/settings.component.ts index 60aa2ebae8..a613328878 100644 --- a/apps/desktop/src/app/accounts/settings.component.ts +++ b/apps/desktop/src/app/accounts/settings.component.ts @@ -42,7 +42,6 @@ export class SettingsComponent implements OnInit { themeOptions: any[]; clearClipboardOptions: any[]; supportsBiometric: boolean; - additionalBiometricSettingsText: string; showAlwaysShowDock = false; requireEnableTray = false; showDuckDuckGoIntegrationOption = false; @@ -283,10 +282,6 @@ export class SettingsComponent implements OnInit { this.showMinToTray = this.platformUtilsService.getDevice() !== DeviceType.LinuxDesktop; this.showAlwaysShowDock = this.platformUtilsService.getDevice() === DeviceType.MacOsDesktop; this.supportsBiometric = await this.platformUtilsService.supportsBiometric(); - this.additionalBiometricSettingsText = - this.biometricText === "unlockWithTouchId" - ? "additionalTouchIdSettings" - : "additionalWindowsHelloSettings"; this.previousVaultTimeout = this.form.value.vaultTimeout; this.refreshTimeoutSettings$ @@ -700,4 +695,15 @@ export class SettingsComponent implements OnInit { throw new Error("Unsupported platform"); } } + + get additionalBiometricSettingsText() { + switch (this.platformUtilsService.getDevice()) { + case DeviceType.MacOsDesktop: + return "additionalTouchIdSettings"; + case DeviceType.WindowsDesktop: + return "additionalWindowsHelloSettings"; + default: + throw new Error("Unsupported platform"); + } + } }