From c7d723f17eebdc858dd9b14e2669ad79187f6363 Mon Sep 17 00:00:00 2001 From: pospyra Date: Fri, 29 Sep 2023 22:28:24 +0300 Subject: [PATCH] removed the second notification --- .../user/user-info-editor/user-info-editor.component.ts | 4 ++-- .../user/user-preferences/user-preferences.component.ts | 9 +-------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/frontend/src/app/modules/user/user-info-editor/user-info-editor.component.ts b/frontend/src/app/modules/user/user-info-editor/user-info-editor.component.ts index aad50a5e2..ac294c8db 100644 --- a/frontend/src/app/modules/user/user-info-editor/user-info-editor.component.ts +++ b/frontend/src/app/modules/user/user-info-editor/user-info-editor.component.ts @@ -79,8 +79,9 @@ export class UserInfoEditorComponent implements OnInit { .pipe(switchMap((user: IUser) => (this.userInfoForm.value.avatar ? this.updateUserAvatar(user) : of(user)))) .subscribe({ next: (user) => { + this.userPreferencesComponent.setPreferences(); this.authService.setUserInfo(user); - this.toastrNotification.showSuccess('User information has been updated'); + this.toastrNotification.showSuccess('Your data have been updated'); this.spinnerService.hide(); }, error: () => { @@ -88,7 +89,6 @@ export class UserInfoEditorComponent implements OnInit { this.spinnerService.hide(); }, }); - this.userPreferencesComponent.setPreferences(); } onImagePicked(event: Event) { diff --git a/frontend/src/app/modules/user/user-preferences/user-preferences.component.ts b/frontend/src/app/modules/user/user-preferences/user-preferences.component.ts index c3cf89d77..89d934e21 100644 --- a/frontend/src/app/modules/user/user-preferences/user-preferences.component.ts +++ b/frontend/src/app/modules/user/user-preferences/user-preferences.component.ts @@ -71,14 +71,7 @@ export class UserPreferencesComponent extends BaseComponent implements OnInit { private updateUserPreferences() { this.userervice .setUserPrefferences(this.newPreferences) - .subscribe({ - next: () => { - this.toastrService.showSuccess('User preferences has been updated'); - }, - error: () => { - this.toastrService.showError('Something went wrong'); - }, - }); + .subscribe(); } private loadData() {