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,26 +225,29 @@ export function LiveStatus({
|
|||||||
<Trans>Live feature is in beta</Trans>
|
<Trans>Live feature is in beta</Trans>
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
<SimpleInlineLinkText
|
{hasLiveStatus && (
|
||||||
label={_(msg`Report this livestream`)}
|
<SimpleInlineLinkText
|
||||||
{...createStaticClick(() => {
|
label={_(msg`Report this livestream`)}
|
||||||
function open() {
|
{...createStaticClick(() => {
|
||||||
reportDialogControl.open({
|
function open() {
|
||||||
subject: {
|
if (!hasLiveStatus) return // already checked above
|
||||||
...profile.status,
|
reportDialogControl.open({
|
||||||
$type: 'app.bsky.actor.defs#statusView',
|
subject: {
|
||||||
},
|
...profile.status,
|
||||||
})
|
$type: 'app.bsky.actor.defs#statusView',
|
||||||
}
|
},
|
||||||
if (dialogContext.isWithinDialog) {
|
})
|
||||||
dialogContext.close(open)
|
}
|
||||||
} else {
|
if (dialogContext.isWithinDialog) {
|
||||||
open()
|
dialogContext.close(open)
|
||||||
}
|
} else {
|
||||||
})}
|
open()
|
||||||
style={[a.text_sm, a.underline, t.atoms.text_contrast_medium]}>
|
}
|
||||||
<Trans>Report</Trans>
|
})}
|
||||||
</SimpleInlineLinkText>
|
style={[a.text_sm, a.underline, t.atoms.text_contrast_medium]}>
|
||||||
|
<Trans>Report</Trans>
|
||||||
|
</SimpleInlineLinkText>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user