1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-21 11:35:34 +01:00

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.
This commit is contained in:
Matt Gibson 2024-03-28 06:53:20 -05:00 committed by GitHub
parent ddae908d86
commit 37735436d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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");
}
}
}