Skip to content

Commit

Permalink
update(CallScreen): Sort chat users by video enabled status (#747)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgmarchi authored Oct 22, 2024
1 parent a4540aa commit a090ed1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib/components/calling/CallScreen.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,11 @@
{/if}
</div>

{#each chat.users as user (user)}
{#each chat.users.sort((a, b) => {
const aVideoEnabled = $remoteStreams[a]?.user?.videoEnabled ? 1 : 0
const bVideoEnabled = $remoteStreams[b]?.user?.videoEnabled ? 1 : 0
return bVideoEnabled - aVideoEnabled
}) as user (user)}
{#if user === get(Store.state.user).key && !userCallOptions.video.enabled}
<Participant participant={$userCache[user]} hasVideo={$userCache[user].media.is_streaming_video} isMuted={muted} isDeafened={userCallOptions.audio.deafened} isTalking={$userCache[user].media.is_playing_audio} />
{:else if $userCache[user] && $userCache[user].key !== get(Store.state.user).key && !$remoteStreams[user]}
Expand Down

0 comments on commit a090ed1

Please sign in to comment.