Only show autofill options if enabled

This commit is contained in:
Thomas Rittson 2021-05-17 13:46:39 +10:00
parent 655877f75f
commit d4055a7613
2 changed files with 9 additions and 2 deletions

View File

@ -268,7 +268,7 @@
</a> </a>
</div> </div>
</div> </div>
<div class="box" *ngIf="cipher.type === cipherType.Login"> <div class="box" *ngIf="showAutoFillOnPageLoadOptions">
<div class="box-content"> <div class="box-content">
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
<label for="autofillOnPageLoad">{{'itemAutoFillOnPageLoad' | i18n}} </label> <label for="autofillOnPageLoad">{{'itemAutoFillOnPageLoad' | i18n}} </label>

View File

@ -24,6 +24,9 @@ import { PopupUtilsService } from '../services/popup-utils.service';
import { LoginUriView } from 'jslib/models/view/loginUriView'; import { LoginUriView } from 'jslib/models/view/loginUriView';
import { AddEditComponent as BaseAddEditComponent } from 'jslib/angular/components/add-edit.component'; import { AddEditComponent as BaseAddEditComponent } from 'jslib/angular/components/add-edit.component';
import { StorageService } from 'jslib/abstractions';
import { ConstantsService } from 'jslib/services';
import { CipherType } from 'jslib/enums';
@Component({ @Component({
selector: 'app-vault-add-edit', selector: 'app-vault-add-edit',
@ -33,6 +36,7 @@ export class AddEditComponent extends BaseAddEditComponent {
currentUris: string[]; currentUris: string[];
showAttachments = true; showAttachments = true;
openAttachmentsInPopup: boolean; openAttachmentsInPopup: boolean;
showAutoFillOnPageLoadOptions: boolean;
constructor(cipherService: CipherService, folderService: FolderService, constructor(cipherService: CipherService, folderService: FolderService,
i18nService: I18nService, platformUtilsService: PlatformUtilsService, i18nService: I18nService, platformUtilsService: PlatformUtilsService,
@ -41,7 +45,7 @@ export class AddEditComponent extends BaseAddEditComponent {
messagingService: MessagingService, private route: ActivatedRoute, messagingService: MessagingService, private route: ActivatedRoute,
private router: Router, private location: Location, private router: Router, private location: Location,
eventService: EventService, policyService: PolicyService, eventService: EventService, policyService: PolicyService,
private popupUtilsService: PopupUtilsService) { private popupUtilsService: PopupUtilsService, private storageService: StorageService) {
super(cipherService, folderService, i18nService, platformUtilsService, auditService, stateService, super(cipherService, folderService, i18nService, platformUtilsService, auditService, stateService,
userService, collectionService, messagingService, eventService, policyService); userService, collectionService, messagingService, eventService, policyService);
} }
@ -106,6 +110,9 @@ export class AddEditComponent extends BaseAddEditComponent {
} }
} }
}, 200); }, 200);
this.showAutoFillOnPageLoadOptions = this.cipher.type === CipherType.Login &&
await this.storageService.get<boolean>(ConstantsService.enableAutoFillOnPageLoadKey);
} }
async submit(): Promise<boolean> { async submit(): Promise<boolean> {