From c1c9db8f95eea6dc6fa23cfb8ca313072e936b60 Mon Sep 17 00:00:00 2001 From: Janis Meister Date: Fri, 30 Jun 2023 13:05:24 +0200 Subject: [PATCH] [feature] add hideNonTalking boolean --- src/App.tsx | 2 ++ src/Viewer.tsx | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/App.tsx b/src/App.tsx index 1d46896..5e00210 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -38,6 +38,7 @@ export default function App() { useEffect(() => { const remoteAppPort = searchParams.get("remoteAppPort"); + console.log(searchParams.get("hideNonTalking")); const tsConnection: ITS5ConnectionHandler = new TS5ConnectionHandler( parseInt(remoteAppPort ?? "5899"), setConnections, @@ -55,6 +56,7 @@ export default function App() { return (
{ if (client.channel?.id === currentChannel?.id && client.channel.connection.id === activeConnectionId) { diff --git a/src/Viewer.tsx b/src/Viewer.tsx index fb55dd0..1acac00 100644 --- a/src/Viewer.tsx +++ b/src/Viewer.tsx @@ -5,16 +5,27 @@ export default function Viewer({ clients, channel, showChannelName = false, + hideNonTalking = false, }: { clients: IClient[] | undefined; channel: IChannel | undefined; showChannelName?: boolean; + hideNonTalking?: boolean; }) { return (
{showChannelName ?

{channel?.properties.name}

: null} {clients?.map((client) => { if (client) { + //* Non-talking client + if ( + hideNonTalking && + (client.properties.inputMuted || client.properties.outputMuted || client.talkStatus == 0) + ) { + return null; + } + + //* Normal client return (
{client.properties.outputMuted ? (