Dont mute posts for a user when viewing their profile

zio/stable
Paul Frazee 2023-01-02 13:45:27 -06:00
parent 8cd2b4a721
commit 99cec71ed7
2 changed files with 10 additions and 3 deletions

View File

@ -24,9 +24,11 @@ import {usePalette} from '../../lib/hooks/usePalette'
export const FeedItem = observer(function ({ export const FeedItem = observer(function ({
item, item,
showReplyLine, showReplyLine,
ignoreMuteFor,
}: { }: {
item: FeedItemModel item: FeedItemModel
showReplyLine?: boolean showReplyLine?: boolean
ignoreMuteFor?: string
}) { }) {
const store = useStores() const store = useStores()
const theme = useTheme() const theme = useTheme()
@ -110,7 +112,11 @@ export const FeedItem = observer(function ({
return ( return (
<> <>
{isChild && !item._isThreadChild && item.replyParent ? ( {isChild && !item._isThreadChild && item.replyParent ? (
<FeedItem item={item.replyParent} showReplyLine /> <FeedItem
item={item.replyParent}
showReplyLine
ignoreMuteFor={ignoreMuteFor}
/>
) : undefined} ) : undefined}
<Link style={outerStyles} href={itemHref} title={itemTitle} noFeedback> <Link style={outerStyles} href={itemHref} title={itemTitle} noFeedback>
{item._isThreadChild && ( {item._isThreadChild && (
@ -201,7 +207,8 @@ export const FeedItem = observer(function ({
</Link> </Link>
</View> </View>
)} )}
{item.post.author.viewer?.muted ? ( {item.post.author.viewer?.muted &&
ignoreMuteFor !== item.post.author.did ? (
<View style={[styles.mutedWarning, pal.btn]}> <View style={[styles.mutedWarning, pal.btn]}>
<FontAwesomeIcon icon={['far', 'eye-slash']} style={s.mr2} /> <FontAwesomeIcon icon={['far', 'eye-slash']} style={s.mr2} />
<Text type="body2">This post is by a muted account.</Text> <Text type="body2">This post is by a muted account.</Text>

View File

@ -142,7 +142,7 @@ export const Profile = observer(({navIdx, visible, params}: ScreenParams) => {
if (item === END_ITEM) { if (item === END_ITEM) {
return <Text style={styles.endItem}>- end of feed -</Text> return <Text style={styles.endItem}>- end of feed -</Text>
} }
return <FeedItem item={item} /> return <FeedItem item={item} ignoreMuteFor={uiState.profile.did} />
} }
} else if (uiState.feed.isEmpty) { } else if (uiState.feed.isEmpty) {
items = items.concat([EMPTY_ITEM]) items = items.concat([EMPTY_ITEM])