Fix instance favicons

Fixes https://gitlab.com/soapbox-pub/soapbox/-/issues/1447
This commit is contained in:
Alex Gleason 2023-06-27 20:21:50 -05:00
parent 14ad6e6fb2
commit fcae0df1f8
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
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),