Allow PiP while awaiting approval to join adhoc calls

This commit is contained in:
ayumi-signal 2024-04-11 13:41:49 -07:00 committed by GitHub
parent e21cb6e34a
commit 92eb036196
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 37 additions and 21 deletions

View file

@ -14,7 +14,7 @@ import type {
GroupCallRemoteParticipantType,
GroupCallVideoRequest,
} from '../types/Calling';
import { CallMode } from '../types/Calling';
import { CallMode, GroupCallJoinState } from '../types/Calling';
import { AvatarColors } from '../types/Colors';
import type { SetRendererCanvasType } from '../state/ducks/calling';
import { useGetCallingFrameBuffer } from '../calling/useGetCallingFrameBuffer';
@ -41,6 +41,7 @@ function NoVideo({
acceptedMessageRequest,
avatarPath,
color,
type: conversationType,
isMe,
phoneNumber,
profileName,
@ -58,7 +59,7 @@ function NoVideo({
badge={undefined}
color={color || AvatarColors[0]}
noteToSelf={false}
conversationType="direct"
conversationType={conversationType}
i18n={i18n}
isMe={isMe}
phoneNumber={phoneNumber}
@ -103,6 +104,10 @@ export function CallingPipRemoteVideo({
return undefined;
}
if (activeCall.joinState !== GroupCallJoinState.Joined) {
return undefined;
}
return maxBy(activeCall.remoteParticipants, participant =>
participant.presenting ? Infinity : participant.speakerTime || -Infinity
);