mirror of https://github.com/vector-im/riot-web
Set silenced state as soon as we get the call
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>pull/21833/head
parent
37f51c7536
commit
e787d14cde
|
@ -63,16 +63,12 @@ export default class IncomingCallBox extends React.Component<IProps, IState> {
|
|||
private onAction = (payload: ActionPayload) => {
|
||||
switch (payload.action) {
|
||||
case 'call_state': {
|
||||
const call = CallHandler.sharedInstance().getCallForRoom(payload.room_id);
|
||||
if (call && call.state === CallState.Ringing) {
|
||||
this.setState({
|
||||
incomingCall: call,
|
||||
silenced: false, // Reset silenced state for new call
|
||||
});
|
||||
const incomingCall = CallHandler.sharedInstance().getCallForRoom(payload.room_id);
|
||||
const silenced = CallHandler.sharedInstance().isCallSilenced(incomingCall.callId);
|
||||
if (incomingCall && incomingCall.state === CallState.Ringing) {
|
||||
this.setState({ incomingCall, silenced });
|
||||
} else {
|
||||
this.setState({
|
||||
incomingCall: null,
|
||||
});
|
||||
this.setState({ incomingCall: null });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue