diff --git a/client/src/components/profile/AvatarUploadForm.vue b/client/src/components/profile/AvatarUploadForm.vue index d043f0ad..2c0a1b46 100644 --- a/client/src/components/profile/AvatarUploadForm.vue +++ b/client/src/components/profile/AvatarUploadForm.vue @@ -3,7 +3,7 @@ diff --git a/client/src/components/profile/Profile.vue b/client/src/components/profile/Profile.vue index 16bdbdcc..f90d05e6 100644 --- a/client/src/components/profile/Profile.vue +++ b/client/src/components/profile/Profile.vue @@ -64,9 +64,14 @@ }, update(store, {data: {updateAvatar: {success}}}) { if (success) { - const data = store.readQuery({query: ME_QUERY}); - if (data) { - data.me.avatarUrl = url; + const {me} = store.readQuery({query: ME_QUERY}); + if (me) { + const data = { + me: { + ...me, + avatarUrl: url + } + }; store.writeQuery({query: ME_QUERY, data}); } }