Skip to content

Conversation

@rileyjshaw
Copy link
Contributor

See #7 for discussion.

@troutowicz
Copy link

troutowicz commented Oct 8, 2024

Would love to see this merged. What we have now works, but adds work.

function useParticipantUserIds({filter}) {
  const daily = useDaily()
  const localSessionId = useLocalSessionId()
  const participantIds = useParticipantIds({filter})

  const userIds = useMemo(() => {
    const userIds = []
    const participants = daily.participants()
    for (let i = 0; i < participantIds.length; i++) {
      const id =
        participantIds[i] === localSessionId ? 'local' : participantIds[i]
      if (participants[id]?.user_id) {
        userIds.push(participants[id].user_id)
      }
    }
    return [...new Set(userIds)]
  }, [daily, localSessionId, participantIds])

  return userIds
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants