Fix link to like-via-repost (#8428)

This commit is contained in:
Samuel Newman
2025-05-30 12:27:24 +03:00
committed by GitHub
parent caf18daa6a
commit 4890648116
@@ -97,29 +97,36 @@ let NotificationFeedItem = ({
const {_, i18n} = useLingui() const {_, i18n} = useLingui()
const [isAuthorsExpanded, setAuthorsExpanded] = useState<boolean>(false) const [isAuthorsExpanded, setAuthorsExpanded] = useState<boolean>(false)
const itemHref = useMemo(() => { const itemHref = useMemo(() => {
if (item.type === 'post-like' || item.type === 'repost') { switch (item.type) {
if (item.subjectUri) { case 'post-like':
const urip = new AtUri(item.subjectUri) case 'repost':
return `/profile/${urip.host}/post/${urip.rkey}` case 'like-via-repost':
case 'repost-via-repost': {
if (item.subjectUri) {
const urip = new AtUri(item.subjectUri)
return `/profile/${urip.host}/post/${urip.rkey}`
}
break
} }
} else if ( case 'follow':
item.type === 'follow' || case 'verified':
item.type === 'verified' || case 'unverified': {
item.type === 'unverified' return makeProfileLink(item.notification.author)
) { }
return makeProfileLink(item.notification.author) case 'reply': {
} else if (item.type === 'reply') { const uripReply = new AtUri(item.notification.uri)
const urip = new AtUri(item.notification.uri) return `/profile/${uripReply.host}/post/${uripReply.rkey}`
return `/profile/${urip.host}/post/${urip.rkey}` }
} else if ( case 'feedgen-like':
item.type === 'feedgen-like' || case 'starterpack-joined': {
item.type === 'starterpack-joined' if (item.subjectUri) {
) { const urip = new AtUri(item.subjectUri)
if (item.subjectUri) { return `/profile/${urip.host}/feed/${urip.rkey}`
const urip = new AtUri(item.subjectUri) }
return `/profile/${urip.host}/feed/${urip.rkey}` break
} }
} }
return '' return ''
}, [item]) }, [item])