From 2c1ded37a172c2b8e10a1b9bda5c2bb5faef7795 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Sun, 30 Mar 2025 07:17:25 -0500 Subject: [PATCH] Ensure we use the stream name from local storage on mobile (#17452) --- web/src/views/live/LiveDashboardView.tsx | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/web/src/views/live/LiveDashboardView.tsx b/web/src/views/live/LiveDashboardView.tsx index 199146b0b..b00b1a2f5 100644 --- a/web/src/views/live/LiveDashboardView.tsx +++ b/web/src/views/live/LiveDashboardView.tsx @@ -472,11 +472,20 @@ export default function LiveDashboardView({ } else { grow = "aspect-video"; } - const streamName = - currentGroupStreamingSettings?.[camera.name]?.streamName || - camera?.live?.streams - ? Object?.values(camera?.live?.streams)?.[0] - : ""; + const availableStreams = camera.live.streams || {}; + const firstStreamEntry = Object.values(availableStreams)[0] || ""; + + const streamNameFromSettings = + currentGroupStreamingSettings?.[camera.name]?.streamName || ""; + const streamExists = + streamNameFromSettings && + Object.values(availableStreams).includes( + streamNameFromSettings, + ); + + const streamName = streamExists + ? streamNameFromSettings + : firstStreamEntry; const autoLive = currentGroupStreamingSettings?.[camera.name]?.streamType !== "no-streaming";