diff --git a/website/client/src/components/userMenu/profile.vue b/website/client/src/components/userMenu/profile.vue index a3120e67cc..53024a5aea 100644 --- a/website/client/src/components/userMenu/profile.vue +++ b/website/client/src/components/userMenu/profile.vue @@ -1222,9 +1222,10 @@ export default { const { nextRewardAt } = currentLoginDay; return ((nextRewardAt - previousRewardDay)); }, - save () { + async save () { const values = {}; const edits = cloneDeep(this.editingProfile); + const oldProfile = cloneDeep(this.user.profile); each(edits, (value, key) => { // Using toString because we need to compare two arrays (websites) @@ -1235,7 +1236,12 @@ export default { } }); - this.$store.dispatch('user:set', values); + await this.$store.dispatch('user:set', values).catch(() => { + this.user.profile = oldProfile; + this.editingProfile.name = this.user.profile.name; + this.editingProfile.imageUrl = this.user.profile.imageUrl; + this.editingProfile.blurb = this.user.profile.blurb; + }); this.editing = false; },