1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 09:13:33 +00:00

Add setting for toggling hide dock

This commit is contained in:
Hinton
2020-11-20 14:05:50 +01:00
parent ac05ec4afc
commit 002dd2752b
3 changed files with 24 additions and 0 deletions

View File

@@ -51,6 +51,8 @@ export class SettingsComponent implements OnInit {
supportsBiometric: boolean;
biometric: boolean;
biometricText: string;
hideDock: boolean;
showHideDock: boolean = false;
constructor(private analytics: Angulartics2, private toasterService: ToasterService,
private i18nService: I18nService, private platformUtilsService: PlatformUtilsService,
@@ -131,6 +133,8 @@ export class SettingsComponent implements OnInit {
this.supportsBiometric = await this.platformUtilsService.supportsBiometric();
this.biometric = await this.vaultTimeoutService.isBiometricLockSet();
this.biometricText = await this.storageService.get<string>(ConstantsService.biometricText);
this.hideDock = await this.storageService.get<boolean>(ElectronConstants.hideDock);
this.showHideDock = this.platformUtilsService.getDevice() === DeviceType.MacOsDesktop;
}
async saveVaultTimeoutOptions() {
@@ -277,6 +281,10 @@ export class SettingsComponent implements OnInit {
});
}
async saveHideDock() {
await this.storageService.save(ElectronConstants.hideDock, this.hideDock);
}
private callAnalytics(name: string, enabled: boolean) {
const status = enabled ? 'Enabled' : 'Disabled';
this.analytics.eventTrack.next({ action: `${status} ${name}` });