Merge branch 'fix-instance-favicons' into 'develop'

Fix instance favicons

Closes #1447

See merge request soapbox-pub/soapbox!2576
This commit is contained in:
Alex Gleason 2023-06-28 01:50:10 +00:00
commit a6a1ed9576
2 changed files with 6 additions and 3 deletions

View file

@ -41,13 +41,17 @@ const InstanceFavicon: React.FC<IInstanceFavicon> = ({ account, disabled }) => {
}
};
if (!account.pleroma?.favicon) {
return null;
}
return (
<button
className='h-4 w-4 flex-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2'
onClick={handleClick}
disabled={disabled}
>
<img src={account.favicon} alt='' title={account.domain} className='max-h-full w-full' />
<img src={account.pleroma.favicon} alt='' title={account.domain} className='max-h-full w-full' />
</button>
);
};
@ -229,7 +233,7 @@ const Account = ({
<HStack alignItems='center' space={1}>
<Text theme='muted' size='sm' direction='ltr' truncate>@{username}</Text>
{account.favicon && (
{account.pleroma?.favicon && (
<InstanceFavicon account={account} disabled={!withLinkToProfile} />
)}

View file

@ -30,7 +30,6 @@ const baseAccountSchema = z.object({
discoverable: z.boolean().catch(false),
display_name: z.string().catch(''),
emojis: filteredArray(customEmojiSchema),
favicon: z.string().catch(''),
fields: filteredArray(fieldSchema),
followers_count: z.number().catch(0),
following_count: z.number().catch(0),