Skip to content

Commit 885394e

Browse files
authored
fix: make it possible to filter screensharing participants (#1965)
Enables `hasScreenShare` participant filter. 🎫 Ticket: https://linear.app/stream/issue/REACT-619/ 📑 Docs: GetStream/docs-content#680
1 parent 3ebee72 commit 885394e

File tree

1 file changed

+7
-4
lines changed
  • packages/react-sdk/src/core/components/CallLayout

1 file changed

+7
-4
lines changed

packages/react-sdk/src/core/components/CallLayout/hooks.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
Comparator,
77
defaultSortPreset,
88
hasAudio,
9+
hasScreenShare,
910
hasVideo,
1011
isPinned,
1112
paginatedLayoutSortPreset,
@@ -23,11 +24,12 @@ export type FilterableParticipant = Pick<
2324
isPinned: boolean;
2425
hasVideo: boolean;
2526
hasAudio: boolean;
27+
hasScreenShare: boolean;
2628
};
2729

2830
export type ParticipantFilter = Filter<FilterableParticipant>;
2931
export type ParticipantPredicate = (
30-
paritcipant: StreamVideoParticipant,
32+
participant: StreamVideoParticipant,
3133
) => boolean;
3234

3335
export const useFilteredParticipants = ({
@@ -74,6 +76,7 @@ export const applyParticipantsFilter = (
7476
isPinned: isPinned(participant),
7577
hasVideo: hasVideo(participant),
7678
hasAudio: hasAudio(participant),
79+
hasScreenShare: hasScreenShare(participant),
7780
},
7881
filter,
7982
);
@@ -111,10 +114,10 @@ export const useSpeakerLayoutSortPreset = (
111114

112115
export const useRawRemoteParticipants = () => {
113116
const { useRawParticipants } = useCallStateHooks();
114-
const rawParicipants = useRawParticipants();
117+
const rawParticipants = useRawParticipants();
115118
return useMemo(
116-
() => rawParicipants.filter((p) => !p.isLocalParticipant),
117-
[rawParicipants],
119+
() => rawParticipants.filter((p) => !p.isLocalParticipant),
120+
[rawParticipants],
118121
);
119122
};
120123

0 commit comments

Comments
 (0)