mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 01:03:35 +00:00
[PM-21021] - fix toggled hidden field state for custom fields view (#14595)
* fix toggled hidden field state for custom fields view * fix hidden field toggle for cards and login details
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// FIXME: Update this file to be type safe and remove this and next line
|
||||
// @ts-strict-ignore
|
||||
import { CommonModule } from "@angular/common";
|
||||
import { Component, Input, OnInit } from "@angular/core";
|
||||
import { Component, Input, OnChanges, OnInit, SimpleChanges } from "@angular/core";
|
||||
|
||||
import { JslibModule } from "@bitwarden/angular/jslib.module";
|
||||
import { EventCollectionService } from "@bitwarden/common/abstractions/event/event-collection.service";
|
||||
@@ -45,7 +45,7 @@ import { VaultAutosizeReadOnlyTextArea } from "../../directives/readonly-textare
|
||||
VaultAutosizeReadOnlyTextArea,
|
||||
],
|
||||
})
|
||||
export class CustomFieldV2Component implements OnInit {
|
||||
export class CustomFieldV2Component implements OnInit, OnChanges {
|
||||
@Input() cipher: CipherView;
|
||||
fieldType = FieldType;
|
||||
fieldOptions: any;
|
||||
@@ -67,6 +67,12 @@ export class CustomFieldV2Component implements OnInit {
|
||||
this.fieldOptions = this.getLinkedFieldsOptionsForCipher();
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
if (changes["cipher"]) {
|
||||
this.revealedHiddenFields = [];
|
||||
}
|
||||
}
|
||||
|
||||
getLinkedType(linkedId: LinkedIdType) {
|
||||
const linkedType = this.fieldOptions.get(linkedId);
|
||||
return this.i18nService.t(linkedType.i18nKey);
|
||||
|
||||
Reference in New Issue
Block a user