From a090ed1f0bc17734dc8c8ec65c7754df3b3e6481 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Gon=C3=A7alves=20Marchi?= Date: Tue, 22 Oct 2024 14:24:42 -0300 Subject: [PATCH] update(CallScreen): Sort chat users by video enabled status (#747) --- src/lib/components/calling/CallScreen.svelte | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/components/calling/CallScreen.svelte b/src/lib/components/calling/CallScreen.svelte index 72e8412d1..5223cb3f9 100644 --- a/src/lib/components/calling/CallScreen.svelte +++ b/src/lib/components/calling/CallScreen.svelte @@ -237,7 +237,11 @@ {/if} - {#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} {:else if $userCache[user] && $userCache[user].key !== get(Store.state.user).key && !$remoteStreams[user]}