mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 13:14:58 +08:00
Set silenced state as soon as we get the call
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
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
Block a user