1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 09:13:33 +00:00

[PM-10514] New TOTP Counter Component (#10486)

* new vault totp countdown component
This commit is contained in:
Jason Ng
2024-08-15 10:03:14 -04:00
committed by GitHub
parent 0b24789449
commit 72767dec74
5 changed files with 149 additions and 20 deletions

View File

@@ -5,7 +5,7 @@ import { Observable, shareReplay } from "rxjs";
import { JslibModule } from "@bitwarden/angular/jslib.module";
import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions";
import { LoginView } from "@bitwarden/common/vault/models/view/login.view";
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import {
CardComponent,
FormFieldModule,
@@ -17,6 +17,8 @@ import {
ColorPasswordModule,
} from "@bitwarden/components";
import { BitTotpCountdownComponent } from "../../components/totp-countdown/totp-countdown.component";
@Component({
selector: "app-login-credentials-view",
templateUrl: "login-credentials-view.component.html",
@@ -32,17 +34,19 @@ import {
IconButtonModule,
BadgeModule,
ColorPasswordModule,
BitTotpCountdownComponent,
],
})
export class LoginCredentialsViewComponent {
@Input() login: LoginView;
@Input() viewPassword: boolean;
@Input() cipher: CipherView;
isPremium$: Observable<boolean> =
this.billingAccountProfileStateService.hasPremiumFromAnySource$.pipe(
shareReplay({ refCount: true, bufferSize: 1 }),
);
showPasswordCount: boolean = false;
passwordRevealed: boolean = false;
totpCopyCode: string;
constructor(
private billingAccountProfileStateService: BillingAccountProfileStateService,
@@ -60,4 +64,8 @@ export class LoginCredentialsViewComponent {
togglePasswordCount() {
this.showPasswordCount = !this.showPasswordCount;
}
setTotpCopyCode(e: any) {
this.totpCopyCode = e;
}
}