Merge pull request #1337 from matrix-org/rav/handle_call_synchronously

Dispatch incoming_call synchronously
pull/21833/head
David Baker 2017-08-24 13:31:13 +01:00 committed by GitHub
commit 3e92380d79
1 changed files with 4 additions and 1 deletions

View File

@ -1068,10 +1068,13 @@ module.exports = React.createClass({
self.setState({ready: true});
});
cli.on('Call.incoming', function(call) {
// we dispatch this synchronously to make sure that the event
// handlers on the call are set up immediately (so that if
// we get an immediate hangup, we don't get a stuck call)
dis.dispatch({
action: 'incoming_call',
call: call,
});
}, true);
});
cli.on('Session.logged_out', function(call) {
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");