From bcab2f231aed672de37677e57f24e799d454c44d Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 20 Jul 2015 16:40:00 +0100 Subject: [PATCH] Add error dialogs for invites and call timeouts. --- src/CallHandler.js | 4 ++++ src/controllers/organisms/MemberList.js | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/CallHandler.js b/src/CallHandler.js index 671d8278..0915a65a 100644 --- a/src/CallHandler.js +++ b/src/CallHandler.js @@ -116,6 +116,10 @@ function _setCallListeners(call) { _setCallState(call, call.roomId, "busy"); pause("ringbackAudio"); play("busyAudio"); + Modal.createDialog(ErrorDialog, { + title: "Call Timeout", + description: "The remote side failed to pick up." + }); } else if (oldState === "invite_sent") { _setCallState(call, call.roomId, "stop_ringback"); diff --git a/src/controllers/organisms/MemberList.js b/src/controllers/organisms/MemberList.js index 6021d0fc..89dd9855 100644 --- a/src/controllers/organisms/MemberList.js +++ b/src/controllers/organisms/MemberList.js @@ -18,6 +18,9 @@ limitations under the License. var React = require("react"); var MatrixClientPeg = require("../../MatrixClientPeg"); +var Modal = require("../../Modal"); +var ComponentBroker = require('../../ComponentBroker'); +var ErrorDialog = ComponentBroker.get("organisms/ErrorDialog"); var INITIAL_LOAD_NUM_MEMBERS = 50; @@ -67,6 +70,10 @@ module.exports = { inputText = inputText.trim(); // react requires es5-shim so we know trim() exists if (inputText[0] !== '@' || inputText.indexOf(":") === -1) { 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; } self.setState({ @@ -81,6 +88,10 @@ module.exports = { }); }, function(err) { console.error("Failed to invite: %s", JSON.stringify(err)); + Modal.createDialog(ErrorDialog, { + title: "Invite Server Error", + description: err.message + }); self.setState({ inviting: false });