Skip to content

Commit

Permalink
Merge pull request #226 from BinaryStudioAcademy/bug-138/two-notifica…
Browse files Browse the repository at this point in the history
…tion

removed the second notification
  • Loading branch information
apofis96 committed Sep 29, 2023
2 parents 68565ab + c7d723f commit ca02ec4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,16 @@ 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: () => {
this.toastrNotification.showError('Something went wrong');
this.spinnerService.hide();
},
});
this.userPreferencesComponent.setPreferences();
}

onImagePicked(event: Event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit ca02ec4

Please sign in to comment.