1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-23 19:53:43 +00:00

Add support for "openAtLogin"

This commit is contained in:
Hinton
2020-11-25 20:43:29 +01:00
parent f926f80d8c
commit f512df309d
4 changed files with 25 additions and 13 deletions

View File

@@ -130,13 +130,13 @@
</div>
<div class="form-group">
<div class="checkbox">
<label for="startOnLogin">
<input id="startOnLogin" type="checkbox" name="StartOnLogin" [(ngModel)]="startOnLogin"
(change)="saveStartOnLogin()">
{{'startOnLogin' | i18n}}
<label for="openAtLogin">
<input id="openAtLogin" type="checkbox" name="OpenAtLogin" [(ngModel)]="openAtLogin"
(change)="saveOpenAtLogin()">
{{'openAtLogin' | i18n}}
</label>
</div>
<small class="help-block">{{'startOnLoginDesc' | i18n}}</small>
<small class="help-block">{{'openAtLoginDesc' | i18n}}</small>
</div>
<div class="form-group" *ngIf="showAlwaysShowDock">
<div class="checkbox">

View File

@@ -51,7 +51,7 @@ export class SettingsComponent implements OnInit {
biometricText: string;
alwaysShowDock: boolean;
showAlwaysShowDock: boolean = false;
startOnLogin: boolean;
openAtLogin: boolean;
enableTrayText: string;
enableTrayDescText: string;
@@ -157,6 +157,7 @@ export class SettingsComponent implements OnInit {
this.biometricText = await this.storageService.get<string>(ConstantsService.biometricText);
this.alwaysShowDock = await this.storageService.get<boolean>(ElectronConstants.alwaysShowDock);
this.showAlwaysShowDock = this.platformUtilsService.getDevice() === DeviceType.MacOsDesktop;
this.openAtLogin = await this.storageService.get<boolean>(ElectronConstants.openAtLogin);
}
async saveVaultTimeoutOptions() {
@@ -307,8 +308,9 @@ export class SettingsComponent implements OnInit {
await this.storageService.save(ElectronConstants.alwaysShowDock, this.alwaysShowDock);
}
async saveStartOnLogin() {
this.messagingService.send(this.startOnLogin ? 'addOpenAtLogin' : 'removeOpenAtLogin');
async saveOpenAtLogin() {
this.storageService.save(ElectronConstants.openAtLogin, this.openAtLogin);
this.messagingService.send(this.openAtLogin ? 'addOpenAtLogin' : 'removeOpenAtLogin');
}
private callAnalytics(name: string, enabled: boolean) {