Adjust Raised Hands button and toast visibility

This commit is contained in:
ayumi-signal 2023-12-08 12:15:18 -08:00 committed by GitHub
parent 5ff101e27a
commit e724f36b79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 79 additions and 31 deletions

View file

@ -108,6 +108,18 @@ const getConversationsByDemuxId = (overrideProps: GroupCallOverrideProps) => {
return conversationsByDemuxId;
};
const getRaisedHands = (overrideProps: GroupCallOverrideProps) => {
if (!overrideProps.remoteParticipants) {
return;
}
return new Set<number>(
overrideProps.remoteParticipants
.filter(participant => participant.isHandRaised)
.map(participant => participant.demuxId)
);
};
const createActiveGroupCallProp = (overrideProps: GroupCallOverrideProps) => ({
callMode: CallMode.Group as CallMode.Group,
connectionState:
@ -124,7 +136,10 @@ const createActiveGroupCallProp = (overrideProps: GroupCallOverrideProps) => ({
isConversationTooBigToRing: false,
peekedParticipants:
overrideProps.peekedParticipants || overrideProps.remoteParticipants || [],
raisedHands: overrideProps.raisedHands || new Set<number>(),
raisedHands:
overrideProps.raisedHands ||
getRaisedHands(overrideProps) ||
new Set<number>(),
remoteParticipants: overrideProps.remoteParticipants || [],
remoteAudioLevels: new Map<number, number>(
overrideProps.remoteParticipants?.map((_participant, index) => [