remove ugly join & reject error msgs in favour of modal dialogs

This commit is contained in:
Matthew Hodgson 2016-02-15 20:59:44 +02:00
parent 30e9c76089
commit b1a6575b1d

View file

@ -1229,11 +1229,19 @@ module.exports = React.createClass({
self.setState({ self.setState({
rejecting: false rejecting: false
}); });
}, function(err) { }, function(error) {
console.error("Failed to reject invite: %s", err); console.error("Failed to reject invite: %s", error);
var msg = error.message ? error.message : JSON.stringify(error);
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
Modal.createDialog(ErrorDialog, {
title: "Failed to reject invite",
description: msg
});
self.setState({ self.setState({
rejecting: false, rejecting: false,
rejectError: err rejectError: error
}); });
}); });
}, },
@ -1427,7 +1435,6 @@ module.exports = React.createClass({
); );
} }
else { else {
var joinErrorText = this.state.joinError ? "Failed to join room!" : "";
return ( return (
<div className="mx_RoomView"> <div className="mx_RoomView">
<RoomHeader ref="header" room={this.state.room} simpleHeader="Join room"/> <RoomHeader ref="header" room={this.state.room} simpleHeader="Join room"/>
@ -1436,7 +1443,6 @@ module.exports = React.createClass({
canJoin={ true } canPreview={ false } canJoin={ true } canPreview={ false }
spinner={this.state.joining} spinner={this.state.joining}
/> />
<div className="error">{joinErrorText}</div>
</div> </div>
<div className="mx_RoomView_messagePanel"></div> <div className="mx_RoomView_messagePanel"></div>
</div> </div>
@ -1462,10 +1468,6 @@ module.exports = React.createClass({
} else { } else {
var inviteEvent = myMember.events.member; var inviteEvent = myMember.events.member;
var inviterName = inviteEvent.sender ? inviteEvent.sender.name : inviteEvent.getSender(); var inviterName = inviteEvent.sender ? inviteEvent.sender.name : inviteEvent.getSender();
// XXX: Leaving this intentionally basic for now because invites are about to change totally
// FIXME: This comment is now outdated - what do we need to fix? ^
var joinErrorText = this.state.joinError ? "Failed to join room!" : "";
var rejectErrorText = this.state.rejectError ? "Failed to reject invite!" : "";
// We deliberately don't try to peek into invites, even if we have permission to peek // We deliberately don't try to peek into invites, even if we have permission to peek
// as they could be a spam vector. // as they could be a spam vector.
@ -1481,8 +1483,6 @@ module.exports = React.createClass({
canJoin={ true } canPreview={ false } canJoin={ true } canPreview={ false }
spinner={this.state.joining} spinner={this.state.joining}
/> />
<div className="error">{joinErrorText}</div>
<div className="error">{rejectErrorText}</div>
</div> </div>
<div className="mx_RoomView_messagePanel"></div> <div className="mx_RoomView_messagePanel"></div>
</div> </div>