Merge branch 'bugfixes' into 'develop'

ProfilePage: don't load account note panel until account is loaded

Closes #1514

See merge request soapbox-pub/soapbox!2677
This commit is contained in:
Alex Gleason 2023-09-14 19:18:52 +00:00
commit 02866ac53f
2 changed files with 5 additions and 6 deletions

View file

@ -44,7 +44,7 @@ const ProfileFamiliarFollowers: React.FC<IProfileFamiliarFollowers> = ({ account
} }
const accounts: Array<React.ReactNode> = familiarFollowers.map(account => !!account && ( const accounts: Array<React.ReactNode> = familiarFollowers.map(account => !!account && (
<HoverRefWrapper accountId={account.id} inline> <HoverRefWrapper accountId={account.id} key={account.id} inline>
<Link className='mention inline-block' to={`/@${account.acct}`}> <Link className='mention inline-block' to={`/@${account.acct}`}>
<HStack space={1} alignItems='center' grow> <HStack space={1} alignItems='center' grow>
<Text <Text
@ -53,17 +53,16 @@ const ProfileFamiliarFollowers: React.FC<IProfileFamiliarFollowers> = ({ account
truncate truncate
dangerouslySetInnerHTML={{ __html: account.display_name_html }} dangerouslySetInnerHTML={{ __html: account.display_name_html }}
/> />
{/* <span dangerouslySetInnerHTML={{ __html: account.display_name_html }} /> */}
{account.verified && <VerificationBadge />} {account.verified && <VerificationBadge />}
</HStack> </HStack>
</Link> </Link>
</HoverRefWrapper> </HoverRefWrapper>
)).toArray(); )).toArray().filter(Boolean);
if (familiarFollowerIds.size > 2) { if (familiarFollowerIds.size > 2) {
accounts.push( accounts.push(
<span className='cursor-pointer hover:underline' role='presentation' onClick={openFamiliarFollowersModal}> <span key='_' className='cursor-pointer hover:underline' role='presentation' onClick={openFamiliarFollowersModal}>
<FormattedMessage <FormattedMessage
id='account.familiar_followers.more' id='account.familiar_followers.more'
defaultMessage='{count, plural, one {# other} other {# others}} you follow' defaultMessage='{count, plural, one {# other} other {# others}} you follow'
@ -76,7 +75,7 @@ const ProfileFamiliarFollowers: React.FC<IProfileFamiliarFollowers> = ({ account
return ( return (
<HStack space={2} alignItems='center'> <HStack space={2} alignItems='center'>
<AvatarStack accountIds={familiarFollowerIds} /> <AvatarStack accountIds={familiarFollowerIds} />
<Text theme='muted' size='sm'> <Text theme='muted' size='sm' tag='div'>
<FormattedMessage <FormattedMessage
id='account.familiar_followers' id='account.familiar_followers'
defaultMessage='Followed by {accounts}' defaultMessage='Followed by {accounts}'

View file

@ -119,7 +119,7 @@ const ProfilePage: React.FC<IProfilePage> = ({ params, children }) => {
</BundleContainer> </BundleContainer>
)} )}
{features.notes && me !== account?.id && ( {features.notes && account && account?.id !== me && (
<BundleContainer fetchComponent={AccountNotePanel}> <BundleContainer fetchComponent={AccountNotePanel}>
{Component => <Component account={account} />} {Component => <Component account={account} />}
</BundleContainer> </BundleContainer>