Guard against chat profile views
This commit is contained in:
@@ -99,6 +99,7 @@ export function LiveStatus({
|
|||||||
const moderationOpts = useModerationOpts()
|
const moderationOpts = useModerationOpts()
|
||||||
const reportDialogControl = useGlobalReportDialogControl()
|
const reportDialogControl = useGlobalReportDialogControl()
|
||||||
const dialogContext = Dialog.useDialogContext()
|
const dialogContext = Dialog.useDialogContext()
|
||||||
|
const hasLiveStatus = 'status' in profile
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -224,10 +225,12 @@ export function LiveStatus({
|
|||||||
<Trans>Live feature is in beta</Trans>
|
<Trans>Live feature is in beta</Trans>
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
{hasLiveStatus && (
|
||||||
<SimpleInlineLinkText
|
<SimpleInlineLinkText
|
||||||
label={_(msg`Report this livestream`)}
|
label={_(msg`Report this livestream`)}
|
||||||
{...createStaticClick(() => {
|
{...createStaticClick(() => {
|
||||||
function open() {
|
function open() {
|
||||||
|
if (!hasLiveStatus) return // already checked above
|
||||||
reportDialogControl.open({
|
reportDialogControl.open({
|
||||||
subject: {
|
subject: {
|
||||||
...profile.status,
|
...profile.status,
|
||||||
@@ -244,6 +247,7 @@ export function LiveStatus({
|
|||||||
style={[a.text_sm, a.underline, t.atoms.text_contrast_medium]}>
|
style={[a.text_sm, a.underline, t.atoms.text_contrast_medium]}>
|
||||||
<Trans>Report</Trans>
|
<Trans>Report</Trans>
|
||||||
</SimpleInlineLinkText>
|
</SimpleInlineLinkText>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user