Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit b65e176

Browse files
committed
Dispatch incoming_call synchronously
- this should fix a race where if the 'hangup' arrives hard on the tail of the Call.incoming, we don't ignore it. (We still have a problem in that we blip the hangup tone and UI, but that is arguably a separate problem)
1 parent cc36304 commit b65e176

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/structures/MatrixChat.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,10 +1068,13 @@ module.exports = React.createClass({
10681068
self.setState({ready: true});
10691069
});
10701070
cli.on('Call.incoming', function(call) {
1071+
// we dispatch this synchronously to make sure that the event
1072+
// handlers on the call are set up immediately (so that if
1073+
// we get an immediate hangup, we don't get a stuck call)
10711074
dis.dispatch({
10721075
action: 'incoming_call',
10731076
call: call,
1074-
});
1077+
}, true);
10751078
});
10761079
cli.on('Session.logged_out', function(call) {
10771080
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");

0 commit comments

Comments
 (0)