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) {
case 'post-like':
case 'repost':
case 'like-via-repost':
case 'repost-via-repost': {
if (item.subjectUri) { if (item.subjectUri) {
const urip = new AtUri(item.subjectUri) const urip = new AtUri(item.subjectUri)
return `/profile/${urip.host}/post/${urip.rkey}` return `/profile/${urip.host}/post/${urip.rkey}`
} }
} else if ( break
item.type === 'follow' || }
item.type === 'verified' || case 'follow':
item.type === 'unverified' case 'verified':
) { case 'unverified': {
return makeProfileLink(item.notification.author) return makeProfileLink(item.notification.author)
} else if (item.type === 'reply') { }
const urip = new AtUri(item.notification.uri) case 'reply': {
return `/profile/${urip.host}/post/${urip.rkey}` const uripReply = new AtUri(item.notification.uri)
} else if ( return `/profile/${uripReply.host}/post/${uripReply.rkey}`
item.type === 'feedgen-like' || }
item.type === 'starterpack-joined' case 'feedgen-like':
) { case 'starterpack-joined': {
if (item.subjectUri) { if (item.subjectUri) {
const urip = new AtUri(item.subjectUri) const urip = new AtUri(item.subjectUri)
return `/profile/${urip.host}/feed/${urip.rkey}` return `/profile/${urip.host}/feed/${urip.rkey}`
} }
break
} }
}
return '' return ''
}, [item]) }, [item])