0
0
Fork 0

Change source attribute of Suggestion entity in /api/v2/suggestions back to a string (#29108)

This commit is contained in:
Claire 2024-02-06 18:10:17 +01:00 committed by GitHub
parent 1e0b0a3486
commit 7ee93b7431
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 41 additions and 10 deletions

View file

@ -59,7 +59,7 @@ Source.propTypes = {
id: PropTypes.oneOf(['friends_of_friends', 'similar_to_recently_followed', 'featured', 'most_followed', 'most_interactions']),
};
const Card = ({ id, source }) => {
const Card = ({ id, sources }) => {
const intl = useIntl();
const account = useSelector(state => state.getIn(['accounts', id]));
const relationship = useSelector(state => state.getIn(['relationships', id]));
@ -89,7 +89,7 @@ const Card = ({ id, source }) => {
<div className='inline-follow-suggestions__body__scrollable__card__text-stack'>
<Link to={`/@${account.get('acct')}`}><DisplayName account={account} /></Link>
{firstVerifiedField ? <VerifiedBadge link={firstVerifiedField.get('value')} /> : <Source id={source.get(0)} />}
{firstVerifiedField ? <VerifiedBadge link={firstVerifiedField.get('value')} /> : <Source id={sources.get(0)} />}
</div>
<Button text={intl.formatMessage(following ? messages.unfollow : messages.follow)} onClick={handleFollow} />
@ -99,7 +99,7 @@ const Card = ({ id, source }) => {
Card.propTypes = {
id: PropTypes.string.isRequired,
source: ImmutablePropTypes.list,
sources: ImmutablePropTypes.list,
};
const DISMISSIBLE_ID = 'home/follow-suggestions';
@ -175,7 +175,7 @@ export const InlineFollowSuggestions = ({ hidden }) => {
<Card
key={suggestion.get('account')}
id={suggestion.get('account')}
source={suggestion.get('source')}
sources={suggestion.get('sources')}
/>
))}
</div>