aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-account/my-account-settings
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+my-account/my-account-settings')
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-settings.component.ts6
1 files changed, 5 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 15f977e58..14293f14c 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
@@ -50,6 +50,10 @@ export class MyAccountSettingsComponent implements OnInit {
50 50
51 changeAvatar () { 51 changeAvatar () {
52 const avatarfile = this.avatarfileInput.nativeElement.files[ 0 ] 52 const avatarfile = this.avatarfileInput.nativeElement.files[ 0 ]
53 if (avatarfile.size > this.maxAvatarSize) {
54 this.notificationsService.error('Error', 'This image is too large.')
55 return
56 }
53 57
54 const formData = new FormData() 58 const formData = new FormData()
55 formData.append('avatarfile', avatarfile) 59 formData.append('avatarfile', avatarfile)
@@ -59,7 +63,7 @@ export class MyAccountSettingsComponent implements OnInit {
59 data => { 63 data => {
60 this.notificationsService.success(this.i18n('Success'), this.i18n('Avatar changed.')) 64 this.notificationsService.success(this.i18n('Success'), this.i18n('Avatar changed.'))
61 65
62 this.user.account.avatar = data.avatar 66 this.user.updateAccountAvatar(data.avatar)
63 }, 67 },
64 68
65 err => this.notificationsService.error(this.i18n('Error'), err.message) 69 err => this.notificationsService.error(this.i18n('Error'), err.message)