aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+my-account/my-account-settings/my-account-settings.component.ts')
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-settings.component.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts b/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts
index 577f4a252..a276bb126 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts
+++ b/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts
@@ -3,6 +3,7 @@ import { HttpErrorResponse } from '@angular/common/http'
3import { AfterViewChecked, Component, OnInit } from '@angular/core' 3import { AfterViewChecked, Component, OnInit } from '@angular/core'
4import { AuthService, Notifier, User, UserService } from '@app/core' 4import { AuthService, Notifier, User, UserService } from '@app/core'
5import { genericUploadErrorHandler } from '@app/helpers' 5import { genericUploadErrorHandler } from '@app/helpers'
6import { shallowCopy } from '@shared/core-utils'
6 7
7@Component({ 8@Component({
8 selector: 'my-account-settings', 9 selector: 'my-account-settings',
@@ -44,6 +45,9 @@ export class MyAccountSettingsComponent implements OnInit, AfterViewChecked {
44 this.notifier.success($localize`Avatar changed.`) 45 this.notifier.success($localize`Avatar changed.`)
45 46
46 this.user.updateAccountAvatar(data.avatars) 47 this.user.updateAccountAvatar(data.avatars)
48
49 // So my-actor-avatar component detects changes
50 this.user.account = shallowCopy(this.user.account)
47 }, 51 },
48 52
49 error: (err: HttpErrorResponse) => genericUploadErrorHandler({ 53 error: (err: HttpErrorResponse) => genericUploadErrorHandler({
@@ -57,10 +61,13 @@ export class MyAccountSettingsComponent implements OnInit, AfterViewChecked {
57 onAvatarDelete () { 61 onAvatarDelete () {
58 this.userService.deleteAvatar() 62 this.userService.deleteAvatar()
59 .subscribe({ 63 .subscribe({
60 next: data => { 64 next: () => {
61 this.notifier.success($localize`Avatar deleted.`) 65 this.notifier.success($localize`Avatar deleted.`)
62 66
63 this.user.updateAccountAvatar() 67 this.user.updateAccountAvatar()
68
69 // So my-actor-avatar component detects changes
70 this.user.account = shallowCopy(this.user.account)
64 }, 71 },
65 72
66 error: (err: HttpErrorResponse) => this.notifier.error(err.message) 73 error: (err: HttpErrorResponse) => this.notifier.error(err.message)