You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-10 09:22:25 +03:00
Sensible error message if we can't invite because we're not allowed
This commit is contained in:
@@ -231,11 +231,18 @@ module.exports = React.createClass({
|
|||||||
}, function(err) {
|
}, function(err) {
|
||||||
if (err !== null) {
|
if (err !== null) {
|
||||||
console.error("Failed to invite: %s", JSON.stringify(err));
|
console.error("Failed to invite: %s", JSON.stringify(err));
|
||||||
|
if (err.errcode == 'M_FORBIDDEN') {
|
||||||
|
Modal.createDialog(ErrorDialog, {
|
||||||
|
title: "Unable to Invite",
|
||||||
|
description: "You do not have permission to invite people to this room."
|
||||||
|
});
|
||||||
|
} else {
|
||||||
Modal.createDialog(ErrorDialog, {
|
Modal.createDialog(ErrorDialog, {
|
||||||
title: "Server error whilst inviting",
|
title: "Server error whilst inviting",
|
||||||
description: err.message
|
description: err.message
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}).finally(function() {
|
}).finally(function() {
|
||||||
self.setState({
|
self.setState({
|
||||||
inviting: false
|
inviting: false
|
||||||
|
|||||||
Reference in New Issue
Block a user