Collection of moderation fixes (#4566)
* Fix: dont blur parents in threads that embed blocks * After tapping 'Show hidden replies', show the individual hider cards * Add shape override to UserAvatar and fix the fallback avi for labelers * Fix precedence * Detect shape for DefaultAvatar --------- Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
This commit is contained in:
parent
ac08c76168
commit
07c2be255f
4 changed files with 41 additions and 14 deletions
|
@ -92,6 +92,8 @@ function PostLabel({
|
|||
<UserAvatar
|
||||
avatar={desc.sourceAvi}
|
||||
size={size === 'large' ? 16 : 12}
|
||||
type="labeler"
|
||||
shape="circle"
|
||||
/>
|
||||
) : (
|
||||
<desc.icon size="sm" fill={t.atoms.text_contrast_medium.color} />
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React, {ComponentProps} from 'react'
|
||||
import {Pressable, StyleProp, StyleSheet, View, ViewStyle} from 'react-native'
|
||||
import {AppBskyActorDefs, ModerationUI} from '@atproto/api'
|
||||
import {AppBskyActorDefs, ModerationCause, ModerationUI} from '@atproto/api'
|
||||
import {msg, Trans} from '@lingui/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
import {useQueryClient} from '@tanstack/react-query'
|
||||
|
@ -45,7 +45,8 @@ export function PostHider({
|
|||
const [override, setOverride] = React.useState(false)
|
||||
const control = useModerationDetailsDialogControl()
|
||||
const blur =
|
||||
modui.blurs[0] || (interpretFilterAsBlur ? modui.filters[0] : undefined)
|
||||
modui.blurs[0] ||
|
||||
(interpretFilterAsBlur ? getBlurrableFilter(modui) : undefined)
|
||||
const desc = useModerationCauseDescription(blur)
|
||||
|
||||
const onBeforePress = React.useCallback(() => {
|
||||
|
@ -134,6 +135,13 @@ export function PostHider({
|
|||
)
|
||||
}
|
||||
|
||||
function getBlurrableFilter(modui: ModerationUI): ModerationCause | undefined {
|
||||
// moderation causes get "downgraded" when they originate from embedded content
|
||||
// a downgraded cause should *only* drive filtering in feeds, so we want to look
|
||||
// for filters that arent downgraded
|
||||
return modui.filters.find(filter => !filter.downgraded)
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
child: {
|
||||
borderWidth: 0,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue