Skip to content

Commit

Permalink
fix: sort active speaker only on first page
Browse files Browse the repository at this point in the history
  • Loading branch information
raviteja83 authored Dec 15, 2023
1 parent 39e90f7 commit 096d50e
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,17 @@ export const GridLayout = ({

useEffect(() => {
if (mainPage !== 0) {
peersSorter.stop();
return;
}
peersSorter.setPeersAndTilesPerPage({
peers: updatedPeers,
tilesPerPage: pageSize,
});
peersSorter.onUpdate(setSortedPeers);
return () => {
peersSorter.stop();
};
}, [mainPage, peersSorter, updatedPeers, pageSize]);

if (peerSharing) {
Expand Down

0 comments on commit 096d50e

Please sign in to comment.