1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 02:33:46 +00:00

Update UI strings, remove autofillOnPageLoad enum

This commit is contained in:
Thomas Rittson
2021-04-16 13:46:56 +10:00
parent 89dd393c32
commit 16f726738d
4 changed files with 23 additions and 18 deletions

View File

@@ -25,7 +25,7 @@
<div class="sub-option">
<label for="defaultAutofill">{{'defaultAutoFillOnPageLoad' | i18n}}</label>
<select id="defaultAutofill" name="DefaultAutofill" [(ngModel)]="autoFillOnPageLoadDefault"
[disabled]="!enableAutoFillOnPageLoad">
(change)="updateAutoFillOnPageLoadDefault()" [disabled]="!enableAutoFillOnPageLoad">
<option *ngFor="let o of autoFillOnPageLoadOptions" [ngValue]="o.value">{{o.name}}</option>
</select>
</div>

View File

@@ -67,14 +67,17 @@ export class OptionsComponent implements OnInit {
{ name: i18nService.t('fiveMinutes'), value: 300 },
];
this.autoFillOnPageLoadOptions = [
{ name: i18nService.t('globalAutoFillOnPageLoadAlways'), value: true },
{ name: i18nService.t('globalAutoFillOnPageLoadNever'), value: false },
{ name: i18nService.t('autoFillOnPageLoadYes'), value: true },
{ name: i18nService.t('autoFillOnPageLoadNo'), value: false },
]
}
async ngOnInit() {
this.enableAutoFillOnPageLoad = await this.storageService.get<boolean>(
ConstantsService.enableAutoFillOnPageLoadKey);
this.autoFillOnPageLoadDefault = await this.storageService.get<boolean>(
ConstantsService.autoFillOnPageLoadDefaultKey) ?? false;
this.disableAddLoginNotification = await this.storageService.get<boolean>(
ConstantsService.disableAddLoginNotificationKey);
@@ -129,6 +132,10 @@ export class OptionsComponent implements OnInit {
this.callAnalytics('Auto-fill Page Load', this.enableAutoFillOnPageLoad);
}
async updateAutoFillOnPageLoadDefault() {
await this.storageService.save(ConstantsService.autoFillOnPageLoadDefaultKey, this.autoFillOnPageLoadDefault);
}
async updateDisableFavicon() {
await this.storageService.save(ConstantsService.disableFaviconKey, this.disableFavicon);
await this.stateService.save(ConstantsService.disableFaviconKey, this.disableFavicon);