From f9892f295e73663cb9518aef3e84f5e5d6d2a0e9 Mon Sep 17 00:00:00 2001 From: rr-bw <102181210+rr-bw@users.noreply.github.com> Date: Thu, 3 Apr 2025 14:37:50 -0700 Subject: [PATCH] refactor rotateUserKey control and calling of setValue() --- .../angular/input-password/input-password.component.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libs/auth/src/angular/input-password/input-password.component.ts b/libs/auth/src/angular/input-password/input-password.component.ts index 2a99b598e84..03cd03ef9b5 100644 --- a/libs/auth/src/angular/input-password/input-password.component.ts +++ b/libs/auth/src/angular/input-password/input-password.component.ts @@ -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; + + 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)?.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)?.setValue(false); + rotateUserKeyCtrl.setValue(false); } } }