Skip to content

Commit bcab2f2

Browse files
committed
Add error dialogs for invites and call timeouts.
1 parent 6fe842e commit bcab2f2

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

‎src/CallHandler.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ function _setCallListeners(call) {
116116
_setCallState(call, call.roomId, "busy");
117117
pause("ringbackAudio");
118118
play("busyAudio");
119+
Modal.createDialog(ErrorDialog, {
120+
title: "Call Timeout",
121+
description: "The remote side failed to pick up."
122+
});
119123
}
120124
else if (oldState === "invite_sent") {
121125
_setCallState(call, call.roomId, "stop_ringback");

‎src/controllers/organisms/MemberList.js‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ limitations under the License.
1818

1919
var React = require("react");
2020
var MatrixClientPeg = require("../../MatrixClientPeg");
21+
var Modal = require("../../Modal");
22+
var ComponentBroker = require('../../ComponentBroker');
23+
var ErrorDialog = ComponentBroker.get("organisms/ErrorDialog");
2124

2225
var INITIAL_LOAD_NUM_MEMBERS = 50;
2326

@@ -67,6 +70,10 @@ module.exports = {
6770
inputText = inputText.trim(); // react requires es5-shim so we know trim() exists
6871
if (inputText[0] !== '@' || inputText.indexOf(":") === -1) {
6972
console.error("Bad user ID to invite: %s", inputText);
73+
Modal.createDialog(ErrorDialog, {
74+
title: "Invite Error",
75+
description: "Malformed user ID. Should look like '@localpart:domain'"
76+
});
7077
return;
7178
}
7279
self.setState({
@@ -81,6 +88,10 @@ module.exports = {
8188
});
8289
}, function(err) {
8390
console.error("Failed to invite: %s", JSON.stringify(err));
91+
Modal.createDialog(ErrorDialog, {
92+
title: "Invite Server Error",
93+
description: err.message
94+
});
8495
self.setState({
8596
inviting: false
8697
});

0 commit comments

Comments
 (0)