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;
|
return noop;
|
||||||
}, [shouldRing, playRingtone, stopRingtone]);
|
}, [shouldRing, playRingtone, stopRingtone]);
|
||||||
|
|
||||||
const hasActiveCall = Boolean(activeCall);
|
const mightBeRingingOutgoingGroupCall =
|
||||||
const isGroupCall = activeCall?.callMode === CallMode.Group;
|
activeCall?.callMode === CallMode.Group &&
|
||||||
|
activeCall.outgoingRing &&
|
||||||
|
activeCall.joinState !== GroupCallJoinState.NotJoined;
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!hasActiveCall || !isGroupCall) {
|
if (!mightBeRingingOutgoingGroupCall) {
|
||||||
return noop;
|
return noop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -395,7 +397,7 @@ export const CallManager: React.FC<PropsType> = props => {
|
||||||
return () => {
|
return () => {
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
};
|
};
|
||||||
}, [hasActiveCall, setOutgoingRing, isGroupCall]);
|
}, [mightBeRingingOutgoingGroupCall, setOutgoingRing]);
|
||||||
|
|
||||||
if (activeCall) {
|
if (activeCall) {
|
||||||
// `props` should logically have an `activeCall` at this point, but TypeScript can't
|
// `props` should logically have an `activeCall` at this point, but TypeScript can't
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue