Fix outbound ring cancelation in lobby
This commit is contained in:
parent
cd809a9922
commit
99daad3f3f
1 changed files with 6 additions and 4 deletions
|
@ -382,10 +382,12 @@ export const CallManager: React.FC<PropsType> = props => {
|
|||
return noop;
|
||||
}, [shouldRing, playRingtone, stopRingtone]);
|
||||
|
||||
const hasActiveCall = Boolean(activeCall);
|
||||
const isGroupCall = activeCall?.callMode === CallMode.Group;
|
||||
const mightBeRingingOutgoingGroupCall =
|
||||
activeCall?.callMode === CallMode.Group &&
|
||||
activeCall.outgoingRing &&
|
||||
activeCall.joinState !== GroupCallJoinState.NotJoined;
|
||||
useEffect(() => {
|
||||
if (!hasActiveCall || !isGroupCall) {
|
||||
if (!mightBeRingingOutgoingGroupCall) {
|
||||
return noop;
|
||||
}
|
||||
|
||||
|
@ -395,7 +397,7 @@ export const CallManager: React.FC<PropsType> = props => {
|
|||
return () => {
|
||||
clearTimeout(timeout);
|
||||
};
|
||||
}, [hasActiveCall, setOutgoingRing, isGroupCall]);
|
||||
}, [mightBeRingingOutgoingGroupCall, setOutgoingRing]);
|
||||
|
||||
if (activeCall) {
|
||||
// `props` should logically have an `activeCall` at this point, but TypeScript can't
|
||||
|
|
Loading…
Add table
Reference in a new issue