diff --git a/resources/js/views/profile/Settings.vue b/resources/js/views/profile/Settings.vue index b2565c78..4f70ae9e 100644 --- a/resources/js/views/profile/Settings.vue +++ b/resources/js/views/profile/Settings.vue @@ -1,9 +1,8 @@ @@ -37,15 +36,16 @@ this.form.post('/api/settings', {returnError: true}) .then(response => { - this.$router.go() + + this.success = response.data.message + + if(response.data.settings.lang !== this.$root.$i18n.locale) { + this.$router.go() + } }) .catch(error => { - if( error.response.status === 400 ) { - this.fail = error.response.data.message - } - else if( error.response.status !== 422 ) { - this.$router.push({ name: 'genericError', params: { err: error.response } }); - } + + this.fail = error.response.data.message }); } },