From 5166f670e764395d8cbb1bf3968b9670faebbc32 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Thu, 8 Jan 2026 15:42:00 -0600 Subject: [PATCH] Guard against chat profile views --- src/components/live/LiveStatusDialog.tsx | 44 +++++++++++++----------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/src/components/live/LiveStatusDialog.tsx b/src/components/live/LiveStatusDialog.tsx index 18559b4108..b95fcd622d 100644 --- a/src/components/live/LiveStatusDialog.tsx +++ b/src/components/live/LiveStatusDialog.tsx @@ -99,6 +99,7 @@ export function LiveStatus({ const moderationOpts = useModerationOpts() const reportDialogControl = useGlobalReportDialogControl() const dialogContext = Dialog.useDialogContext() + const hasLiveStatus = 'status' in profile return ( <> @@ -224,26 +225,29 @@ export function LiveStatus({ Live feature is in beta - { - function open() { - reportDialogControl.open({ - subject: { - ...profile.status, - $type: 'app.bsky.actor.defs#statusView', - }, - }) - } - if (dialogContext.isWithinDialog) { - dialogContext.close(open) - } else { - open() - } - })} - style={[a.text_sm, a.underline, t.atoms.text_contrast_medium]}> - Report - + {hasLiveStatus && ( + { + function open() { + if (!hasLiveStatus) return // already checked above + reportDialogControl.open({ + subject: { + ...profile.status, + $type: 'app.bsky.actor.defs#statusView', + }, + }) + } + if (dialogContext.isWithinDialog) { + dialogContext.close(open) + } else { + open() + } + })} + style={[a.text_sm, a.underline, t.atoms.text_contrast_medium]}> + Report + + )}