Update Profile component, improve error messages when block/mute limit reached

This commit is contained in:
Daniel Supernault 2021-10-20 04:17:46 -06:00
parent bc16b936d6
commit 02237845b5
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -1078,7 +1078,11 @@
this.$refs.visitorContextMenu.hide(); this.$refs.visitorContextMenu.hide();
swal('Success', 'You have successfully muted ' + this.profile.acct, 'success'); swal('Success', 'You have successfully muted ' + this.profile.acct, 'success');
}).catch(err => { }).catch(err => {
if(err.response.status == 422) {
swal('Error', err.response.data.error, 'error');
} else {
swal('Error', 'Something went wrong. Please try again later.', 'error'); swal('Error', 'Something went wrong. Please try again later.', 'error');
}
}); });
}, },
@ -1113,7 +1117,11 @@
this.$refs.visitorContextMenu.hide(); this.$refs.visitorContextMenu.hide();
swal('Success', 'You have successfully blocked ' + this.profile.acct, 'success'); swal('Success', 'You have successfully blocked ' + this.profile.acct, 'success');
}).catch(err => { }).catch(err => {
if(err.response.status == 422) {
swal('Error', err.response.data.error, 'error');
} else {
swal('Error', 'Something went wrong. Please try again later.', 'error'); swal('Error', 'Something went wrong. Please try again later.', 'error');
}
}); });
}, },