mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-17 15:37:57 +01:00
Adding mask and toggle for Card Security Code (#5)
* Adding mask and toggle for Card Security Code * For Card Code Mask - show same number of characters as code
This commit is contained in:
parent
cfad521ea8
commit
1ab6ce6ec0
@ -31,6 +31,7 @@ export class ViewComponent implements OnDestroy {
|
|||||||
|
|
||||||
cipher: CipherView;
|
cipher: CipherView;
|
||||||
showPassword: boolean;
|
showPassword: boolean;
|
||||||
|
showCardCode: boolean;
|
||||||
isPremium: boolean;
|
isPremium: boolean;
|
||||||
totpCode: string;
|
totpCode: string;
|
||||||
totpCodeFormatted: string;
|
totpCodeFormatted: string;
|
||||||
@ -80,6 +81,11 @@ export class ViewComponent implements OnDestroy {
|
|||||||
this.showPassword = !this.showPassword;
|
this.showPassword = !this.showPassword;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toggleCardCode() {
|
||||||
|
this.analytics.eventTrack.next({ action: 'Toggled Card Code' });
|
||||||
|
this.showCardCode = !this.showCardCode;
|
||||||
|
}
|
||||||
|
|
||||||
async checkPassword() {
|
async checkPassword() {
|
||||||
if (this.cipher.login == null || this.cipher.login.password == null || this.cipher.login.password === '') {
|
if (this.cipher.login == null || this.cipher.login.password == null || this.cipher.login.password === '') {
|
||||||
return;
|
return;
|
||||||
|
@ -18,6 +18,10 @@ export class CardView implements View {
|
|||||||
// ctor
|
// ctor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get maskedCode(): string {
|
||||||
|
return this.code != null ? '•'.repeat(this.code.length) : null;
|
||||||
|
}
|
||||||
|
|
||||||
get brand(): string {
|
get brand(): string {
|
||||||
return this._brand;
|
return this._brand;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user