1
0
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:
rr-bw
2025-04-03 14:37:50 -07:00
parent cc52fcc1e6
commit f9892f295e

View File

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