mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 06:13:38 +00:00
reset password input back to password (#16010)
This commit is contained in:
@@ -36,6 +36,7 @@
|
|||||||
[ngClass]="{ 'tw-hidden': passwordRevealed }"
|
[ngClass]="{ 'tw-hidden': passwordRevealed }"
|
||||||
readonly
|
readonly
|
||||||
bitInput
|
bitInput
|
||||||
|
#passwordInput
|
||||||
type="password"
|
type="password"
|
||||||
[value]="cipher.login.password"
|
[value]="cipher.login.password"
|
||||||
aria-readonly="true"
|
aria-readonly="true"
|
||||||
|
|||||||
@@ -3,12 +3,14 @@
|
|||||||
import { CommonModule, DatePipe } from "@angular/common";
|
import { CommonModule, DatePipe } from "@angular/common";
|
||||||
import {
|
import {
|
||||||
Component,
|
Component,
|
||||||
|
ElementRef,
|
||||||
EventEmitter,
|
EventEmitter,
|
||||||
inject,
|
inject,
|
||||||
Input,
|
Input,
|
||||||
OnChanges,
|
OnChanges,
|
||||||
Output,
|
Output,
|
||||||
SimpleChanges,
|
SimpleChanges,
|
||||||
|
ViewChild,
|
||||||
} from "@angular/core";
|
} from "@angular/core";
|
||||||
import { Observable, switchMap } from "rxjs";
|
import { Observable, switchMap } from "rxjs";
|
||||||
|
|
||||||
@@ -61,6 +63,8 @@ export class LoginCredentialsViewComponent implements OnChanges {
|
|||||||
@Input() activeUserId: UserId;
|
@Input() activeUserId: UserId;
|
||||||
@Input() hadPendingChangePasswordTask: boolean;
|
@Input() hadPendingChangePasswordTask: boolean;
|
||||||
@Output() handleChangePassword = new EventEmitter<void>();
|
@Output() handleChangePassword = new EventEmitter<void>();
|
||||||
|
@ViewChild("passwordInput")
|
||||||
|
private passwordInput!: ElementRef<HTMLInputElement>;
|
||||||
|
|
||||||
isPremium$: Observable<boolean> = this.accountService.activeAccount$.pipe(
|
isPremium$: Observable<boolean> = this.accountService.activeAccount$.pipe(
|
||||||
switchMap((account) =>
|
switchMap((account) =>
|
||||||
@@ -92,6 +96,10 @@ export class LoginCredentialsViewComponent implements OnChanges {
|
|||||||
|
|
||||||
ngOnChanges(changes: SimpleChanges): void {
|
ngOnChanges(changes: SimpleChanges): void {
|
||||||
if (changes["cipher"]) {
|
if (changes["cipher"]) {
|
||||||
|
if (this.passwordInput?.nativeElement) {
|
||||||
|
// Reset password input type in case it's been toggled
|
||||||
|
this.passwordInput.nativeElement.type = "password";
|
||||||
|
}
|
||||||
this.passwordRevealed = false;
|
this.passwordRevealed = false;
|
||||||
this.showPasswordCount = false;
|
this.showPasswordCount = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user