Add error dialogs for invites and call timeouts.
This commit is contained in:
parent
6fe842e130
commit
bcab2f231a
|
@ -116,6 +116,10 @@ function _setCallListeners(call) {
|
||||||
_setCallState(call, call.roomId, "busy");
|
_setCallState(call, call.roomId, "busy");
|
||||||
pause("ringbackAudio");
|
pause("ringbackAudio");
|
||||||
play("busyAudio");
|
play("busyAudio");
|
||||||
|
Modal.createDialog(ErrorDialog, {
|
||||||
|
title: "Call Timeout",
|
||||||
|
description: "The remote side failed to pick up."
|
||||||
|
});
|
||||||
}
|
}
|
||||||
else if (oldState === "invite_sent") {
|
else if (oldState === "invite_sent") {
|
||||||
_setCallState(call, call.roomId, "stop_ringback");
|
_setCallState(call, call.roomId, "stop_ringback");
|
||||||
|
|
|
@ -18,6 +18,9 @@ limitations under the License.
|
||||||
|
|
||||||
var React = require("react");
|
var React = require("react");
|
||||||
var MatrixClientPeg = require("../../MatrixClientPeg");
|
var MatrixClientPeg = require("../../MatrixClientPeg");
|
||||||
|
var Modal = require("../../Modal");
|
||||||
|
var ComponentBroker = require('../../ComponentBroker');
|
||||||
|
var ErrorDialog = ComponentBroker.get("organisms/ErrorDialog");
|
||||||
|
|
||||||
var INITIAL_LOAD_NUM_MEMBERS = 50;
|
var INITIAL_LOAD_NUM_MEMBERS = 50;
|
||||||
|
|
||||||
|
@ -67,6 +70,10 @@ module.exports = {
|
||||||
inputText = inputText.trim(); // react requires es5-shim so we know trim() exists
|
inputText = inputText.trim(); // react requires es5-shim so we know trim() exists
|
||||||
if (inputText[0] !== '@' || inputText.indexOf(":") === -1) {
|
if (inputText[0] !== '@' || inputText.indexOf(":") === -1) {
|
||||||
console.error("Bad user ID to invite: %s", inputText);
|
console.error("Bad user ID to invite: %s", inputText);
|
||||||
|
Modal.createDialog(ErrorDialog, {
|
||||||
|
title: "Invite Error",
|
||||||
|
description: "Malformed user ID. Should look like '@localpart:domain'"
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
self.setState({
|
self.setState({
|
||||||
|
@ -81,6 +88,10 @@ module.exports = {
|
||||||
});
|
});
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
console.error("Failed to invite: %s", JSON.stringify(err));
|
console.error("Failed to invite: %s", JSON.stringify(err));
|
||||||
|
Modal.createDialog(ErrorDialog, {
|
||||||
|
title: "Invite Server Error",
|
||||||
|
description: err.message
|
||||||
|
});
|
||||||
self.setState({
|
self.setState({
|
||||||
inviting: false
|
inviting: false
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue