From 0bada56b825ed3c91e7ae9857a59b2d7d515a8f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Gon=C3=A7alves?= Date: Fri, 17 Mar 2023 13:21:34 +0000 Subject: [PATCH] PM-1440 Fix showing multiple warnings (#5021) --- .../components/change-password.component.ts | 48 ++++++++++--------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/libs/angular/src/auth/components/change-password.component.ts b/libs/angular/src/auth/components/change-password.component.ts index 3a2c9bf827..ce927ac3c5 100644 --- a/libs/angular/src/auth/components/change-password.component.ts +++ b/libs/angular/src/auth/components/change-password.component.ts @@ -167,31 +167,33 @@ export class ChangePasswordComponent implements OnInit, OnDestroy { if (!result) { return false; } - } - if (weakPassword) { - const result = await this.platformUtilsService.showDialog( - this.i18nService.t("weakMasterPasswordDesc"), - this.i18nService.t("weakMasterPassword"), - this.i18nService.t("yes"), - this.i18nService.t("no"), - "warning" - ); - if (!result) { - return false; - } - } - if (this.leakedPassword) { - const result = await this.platformUtilsService.showDialog( - this.i18nService.t("exposedMasterPasswordDesc"), - this.i18nService.t("exposedMasterPassword"), - this.i18nService.t("yes"), - this.i18nService.t("no"), - "warning" - ); - if (!result) { - return false; + } else { + if (weakPassword) { + const result = await this.platformUtilsService.showDialog( + this.i18nService.t("weakMasterPasswordDesc"), + this.i18nService.t("weakMasterPassword"), + this.i18nService.t("yes"), + this.i18nService.t("no"), + "warning" + ); + if (!result) { + return false; + } + } + if (this.leakedPassword) { + const result = await this.platformUtilsService.showDialog( + this.i18nService.t("exposedMasterPasswordDesc"), + this.i18nService.t("exposedMasterPassword"), + this.i18nService.t("yes"), + this.i18nService.t("no"), + "warning" + ); + if (!result) { + return false; + } } } + return true; }