mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Fixed incorrect actor passed from like notifications (#21451)
ref https://linear.app/ghost/issue/AP-541/incorrect-object-loaded-on-like-notifications - We were passing the wrong `actor` info from `like` notifications. We should be using `activity.object.attributedTo` instead.
This commit is contained in:
parent
71fb9f8b34
commit
c29905155f
2 changed files with 4 additions and 3 deletions
|
@ -11,6 +11,7 @@ import MainNavigation from './navigation/MainNavigation';
|
|||
import ViewProfileModal from './global/ViewProfileModal';
|
||||
|
||||
import getUsername from '../utils/get-username';
|
||||
import {ActorProperties} from '@tryghost/admin-x-framework/api/activitypub';
|
||||
import {useActivitiesForUser} from '../hooks/useActivityPubQueries';
|
||||
// import {useFollowersForUser} from '../MainContent';
|
||||
|
||||
|
@ -151,7 +152,7 @@ const Activities: React.FC<ActivitiesProps> = ({}) => {
|
|||
case ACTVITY_TYPE.LIKE:
|
||||
NiceModal.show(ArticleModal, {
|
||||
object: activity.object,
|
||||
actor: activity.actor,
|
||||
actor: activity.object.attributedTo as ActorProperties,
|
||||
comments: activity.object.replies
|
||||
});
|
||||
break;
|
||||
|
|
|
@ -371,7 +371,7 @@ const FeedItem: React.FC<FeedItemProps> = ({actor, object, layout, type, comment
|
|||
<div className='relative z-10 flex w-full min-w-0 flex-col overflow-visible text-[1.5rem]'>
|
||||
<div className='flex w-full'>
|
||||
<span className='min-w-0 truncate whitespace-nowrap font-bold after:mx-1 after:font-normal after:text-grey-700 after:content-["·"]' data-test-activity-heading>{author.name}</span>
|
||||
<div className='ml-2'>{renderTimestamp(object)}</div>
|
||||
<div>{renderTimestamp(object)}</div>
|
||||
</div>
|
||||
<div className='flex w-full'>
|
||||
<span className='min-w-0 truncate text-grey-700'>{getUsername(author)}</span>
|
||||
|
@ -420,7 +420,7 @@ const FeedItem: React.FC<FeedItemProps> = ({actor, object, layout, type, comment
|
|||
<div className='relative z-10 flex w-full min-w-0 flex-col overflow-visible text-[1.5rem]'>
|
||||
<div className='flex'>
|
||||
<span className='min-w-0 truncate whitespace-nowrap font-bold after:mx-1 after:font-normal after:text-grey-700 after:content-["·"]' data-test-activity-heading>{author.name}</span>
|
||||
<div className='ml-2'>{renderTimestamp(object)}</div>
|
||||
<div>{renderTimestamp(object)}</div>
|
||||
</div>
|
||||
<div className='flex'>
|
||||
<span className='truncate text-grey-700'>{getUsername(author)}</span>
|
||||
|
|
Loading…
Add table
Reference in a new issue