mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 00:33:44 +00:00
feat: add hidden char count toggle (#341)
Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
This commit is contained in:
committed by
GitHub
parent
78b5f15042
commit
2779cd0966
@@ -23,8 +23,17 @@ export class ViewCustomFieldsComponent {
|
||||
|
||||
const f = field as any;
|
||||
f.showValue = !f.showValue;
|
||||
f.showCount = false;
|
||||
if (f.showValue) {
|
||||
this.eventService.collect(EventType.Cipher_ClientToggledHiddenFieldVisible, this.cipher.id);
|
||||
}
|
||||
}
|
||||
|
||||
async toggleFieldCount(field: FieldView) {
|
||||
if (!field.showValue) {
|
||||
return;
|
||||
}
|
||||
|
||||
field.showCount = !field.showCount;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ export class ViewComponent implements OnDestroy, OnInit {
|
||||
|
||||
cipher: CipherView;
|
||||
showPassword: boolean;
|
||||
showPasswordCount: boolean;
|
||||
showCardNumber: boolean;
|
||||
showCardCode: boolean;
|
||||
canAccessPremium: boolean;
|
||||
@@ -218,11 +219,20 @@ export class ViewComponent implements OnDestroy, OnInit {
|
||||
}
|
||||
|
||||
this.showPassword = !this.showPassword;
|
||||
this.showPasswordCount = false;
|
||||
if (this.showPassword) {
|
||||
this.eventService.collect(EventType.Cipher_ClientToggledPasswordVisible, this.cipherId);
|
||||
}
|
||||
}
|
||||
|
||||
async togglePasswordCount() {
|
||||
if (!this.showPassword) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.showPasswordCount = !this.showPasswordCount;
|
||||
}
|
||||
|
||||
async toggleCardNumber() {
|
||||
if (!(await this.promptPassword())) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user