diff --git a/npm/ng-packs/packages/account/src/lib/components/change-password/change-password.component.ts b/npm/ng-packs/packages/account/src/lib/components/change-password/change-password.component.ts index be281c0cb9..84e87f7ce7 100644 --- a/npm/ng-packs/packages/account/src/lib/components/change-password/change-password.component.ts +++ b/npm/ng-packs/packages/account/src/lib/components/change-password/change-password.component.ts @@ -1,7 +1,7 @@ import { ChangePassword, ProfileState } from '@abp/ng.core'; import { getPasswordValidators, ToasterService } from '@abp/ng.theme.shared'; import { Component, OnInit } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; import { comparePasswords, Validation } from '@ngx-validate/core'; import { Store } from '@ngxs/store'; import { finalize } from 'rxjs/operators'; @@ -80,17 +80,18 @@ export class ChangePasswordComponent .subscribe({ next: () => { this.form.reset(); - this.toasterService.success('AbpAccount::PasswordChangedMessage', 'Success', { + this.toasterService.success('AbpAccount::PasswordChangedMessage', '', { life: 5000, }); + + if (this.hideCurrentPassword) { + this.hideCurrentPassword = false; + this.form.addControl('password', new FormControl('', [required])); + } }, error: err => { this.toasterService.error( snq(() => err.error.error.message, 'AbpAccount::DefaultErrorMessage'), - 'Error', - { - life: 7000, - }, ); }, });