From 751b1dc912d9d730ce4a1cf114101d049710054d Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Fri, 7 Feb 2025 11:59:15 +0100 Subject: [PATCH] Centralize loading logic --- apps/web/src/app/auth/settings/change-password.component.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/web/src/app/auth/settings/change-password.component.ts b/apps/web/src/app/auth/settings/change-password.component.ts index 9f04190fcc4..67eb4984716 100644 --- a/apps/web/src/app/auth/settings/change-password.component.ts +++ b/apps/web/src/app/auth/settings/change-password.component.ts @@ -143,7 +143,9 @@ export class ChangePasswordComponent async submit() { if (this.userkeyRotationV2) { + this.loading = true; await this.submitNew(); + this.loading = false; } else { await this.submitOld(); } @@ -159,7 +161,6 @@ export class ChangePasswordComponent return; } - this.loading = true; if ( this.masterPasswordHint != null && this.masterPasswordHint.toLowerCase() === this.masterPassword.toLowerCase() @@ -169,7 +170,6 @@ export class ChangePasswordComponent title: this.i18nService.t("errorOccurred"), message: this.i18nService.t("hintEqualsPassword"), }); - this.loading = false; return; } @@ -179,7 +179,6 @@ export class ChangePasswordComponent } if (!(await this.strongPassword())) { - this.loading = false; return; } @@ -203,7 +202,6 @@ export class ChangePasswordComponent message: e.message, }); } - this.loading = false; } // todo: move this to a service