1
0
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:
Melanie Kanavakatini
2022-02-23 21:18:46 +00:00
committed by GitHub
parent 78b5f15042
commit 2779cd0966
10 changed files with 51 additions and 1 deletions

View File

@@ -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;
}
}

View File

@@ -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;