show speaking user at first in call status bar

This commit is contained in:
Ajay Bura 2026-10-18 08:54:11 +05:30
commit 97dbdfe806

View file

@ -1,5 +1,5 @@
import { Box, config, Icon, Icons, Text } from 'folds';
import React from 'react';
import React, { useMemo } from 'react';
import { UserAvatar } from '../../components/user-avatar';
import { useMediaAuthentication } from '../../hooks/useMediaAuthentication';
import { StackedAvatar } from '../../components/stacked-avatar';
@ -22,7 +22,16 @@ export function MemberGlance({ roomId, users, membersAPI, speakers, max = 6 }: M
const useAuthentication = useMediaAuthentication();
const openUserProfile = useOpenUserRoomProfile();
const visibleMembers = users.slice(0, max);
const visibleMembers = useMemo(
() =>
Array.from(users)
.sort((a, b) => {
if (speakers.has(a) === speakers.has(b)) return 0;
return speakers.has(a) ? -1 : 1;
})
.slice(0, max),
[users, speakers, max]
);
const remainingCount = max && users.length > max ? users.length - max : 0;
return (