pl-fe: support missing avatar/header image from Mitra
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
bbd524f074
commit
fa46081ba7
1 changed files with 6 additions and 5 deletions
|
@ -30,9 +30,10 @@ const getAcct = (account: Pick<Account, 'fqn' | 'acct'>, displayFqn: boolean): s
|
||||||
|
|
||||||
/** Default header filenames from various backends */
|
/** Default header filenames from various backends */
|
||||||
const DEFAULT_HEADERS: string[] = [
|
const DEFAULT_HEADERS: string[] = [
|
||||||
'/headers/original/missing.png', // Mastodon
|
|
||||||
'/images/banner.png', // Pleroma
|
|
||||||
'/assets/default_header.webp', // GoToSocial
|
'/assets/default_header.webp', // GoToSocial
|
||||||
|
'/headers/original/missing.png', // Mastodon
|
||||||
|
'/api/v1/accounts/identicon', // Mitra
|
||||||
|
'/images/banner.png', // Pleroma
|
||||||
require('pl-fe/assets/images/header-missing.png'), // header not provided by backend
|
require('pl-fe/assets/images/header-missing.png'), // header not provided by backend
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -41,10 +42,10 @@ const isDefaultHeader = (url: string) => DEFAULT_HEADERS.some(header => url.ends
|
||||||
|
|
||||||
/** Default avatar filenames from various backends */
|
/** Default avatar filenames from various backends */
|
||||||
const DEFAULT_AVATARS = [
|
const DEFAULT_AVATARS = [
|
||||||
'/avatars/original/missing.png', // Mastodon
|
|
||||||
'/images/avi.png', // Pleroma
|
|
||||||
...(range(1, 6).map(i => `/assets/default_avatars/GoToSocial_icon${i}.webp`)), // GoToSocial
|
...(range(1, 6).map(i => `/assets/default_avatars/GoToSocial_icon${i}.webp`)), // GoToSocial
|
||||||
'/assets/default_avatars/GoToSocial_icon2.webp', // GoToSocial
|
'/avatars/original/missing.png', // Mastodon
|
||||||
|
'/api/v1/accounts/identicon', // Mitra
|
||||||
|
'/images/avi.png', // Pleroma
|
||||||
require('pl-fe/assets/images/avatar-missing.png'), // avatar not provided by backend
|
require('pl-fe/assets/images/avatar-missing.png'), // avatar not provided by backend
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue