Make startCallLobby resilient to re-entrant calls

This commit is contained in:
Scott Nonnenberg 2024-09-19 09:29:14 +10:00 committed by GitHub
parent be4036f4ab
commit b9cd858ec7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 498 additions and 150 deletions

View file

@ -11,6 +11,7 @@ import type {
CallLinksByRoomIdType,
DirectCallStateType,
GroupCallStateType,
ActiveCallStateType,
} from '../ducks/calling';
import { getIncomingCall as getIncomingCallHelper } from '../ducks/callingHelpers';
import { CallMode } from '../../types/CallDisposition';
@ -55,7 +56,13 @@ export const getSelectedCamera = createSelector(
export const getActiveCallState = createSelector(
getCalling,
(state: CallingStateType) => state.activeCallState
(state: CallingStateType) => {
if (state.activeCallState?.state !== 'Active') {
return undefined;
}
return state.activeCallState;
}
);
export const getCallsByConversation = createSelector(
@ -134,9 +141,9 @@ export const isInCall = createSelector(
);
export const isInFullScreenCall = createSelector(
getCalling,
(state: CallingStateType): boolean =>
Boolean(state.activeCallState && !state.activeCallState.pip)
getActiveCallState,
(activeCallState: undefined | ActiveCallStateType): boolean =>
Boolean(activeCallState?.pip)
);
export const getIncomingCall = createSelector(