mirror of
https://github.com/bitwarden/browser
synced 2026-02-10 05:30:01 +00:00
refactor rotateUserKey control and calling of setValue()
This commit is contained in:
@@ -414,7 +414,11 @@ export class InputPasswordComponent implements OnInit {
|
||||
}
|
||||
|
||||
async rotateUserKeyClicked() {
|
||||
const rotateUserKey = this.formGroup.get("rotateUserKey")?.value;
|
||||
const rotateUserKeyCtrl = this.formGroup.get(
|
||||
"rotateUserKey",
|
||||
) as unknown as FormControl<boolean>;
|
||||
|
||||
const rotateUserKey = rotateUserKeyCtrl?.value;
|
||||
|
||||
if (rotateUserKey) {
|
||||
const activeUserId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId));
|
||||
@@ -445,7 +449,7 @@ export class InputPasswordComponent implements OnInit {
|
||||
);
|
||||
}
|
||||
|
||||
(this.formGroup.get("rotateUserKey") as unknown as FormControl<boolean>)?.setValue(false);
|
||||
rotateUserKeyCtrl.setValue(false);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -461,7 +465,7 @@ export class InputPasswordComponent implements OnInit {
|
||||
});
|
||||
|
||||
if (!result) {
|
||||
(this.formGroup.get("rotateUserKey") as unknown as FormControl<boolean>)?.setValue(false);
|
||||
rotateUserKeyCtrl.setValue(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user