Showing
1 changed file
with
4 additions
and
3 deletions
... | ... | @@ -25,7 +25,7 @@ import { AdminService } from '@core/http/admin.service'; |
25 | 25 | import { ActionNotificationShow } from '@core/notification/notification.actions'; |
26 | 26 | import { TranslateService } from '@ngx-translate/core'; |
27 | 27 | import { HasConfirmForm } from '@core/guards/confirm-on-exit.guard'; |
28 | -import { isString } from '@core/utils'; | |
28 | +import { deepClone, isString } from '@core/utils'; | |
29 | 29 | import { Subject } from 'rxjs'; |
30 | 30 | import { takeUntil } from 'rxjs/operators'; |
31 | 31 | |
... | ... | @@ -148,9 +148,10 @@ export class MailServerComponent extends PageComponent implements OnInit, OnDest |
148 | 148 | this.adminService.saveAdminSettings(this.adminSettings).subscribe( |
149 | 149 | (adminSettings) => { |
150 | 150 | adminSettings.jsonValue.password = this.mailSettings.value.password; |
151 | - adminSettings.jsonValue.changePassword = this.mailSettings.value.changePassword; | |
152 | 151 | this.adminSettings = adminSettings; |
153 | - this.mailSettings.reset(this.adminSettings.jsonValue); | |
152 | + const formSettings = deepClone(this.adminSettings.jsonValue); | |
153 | + formSettings.changePassword = this.mailSettings.get('changePassword').value || this.isDemo; | |
154 | + this.mailSettings.reset(formSettings, {emitEvent: false}); | |
154 | 155 | } |
155 | 156 | ); |
156 | 157 | } | ... | ... |