From fa46081ba7dd5d973810947e7ccd05361d9a4aa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Mon, 16 Sep 2024 23:08:33 +0200 Subject: [PATCH] pl-fe: support missing avatar/header image from Mitra MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- packages/pl-fe/src/utils/accounts.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/pl-fe/src/utils/accounts.ts b/packages/pl-fe/src/utils/accounts.ts index 0f2e7284ac..a5953d2424 100644 --- a/packages/pl-fe/src/utils/accounts.ts +++ b/packages/pl-fe/src/utils/accounts.ts @@ -30,9 +30,10 @@ const getAcct = (account: Pick, displayFqn: boolean): s /** Default header filenames from various backends */ const DEFAULT_HEADERS: string[] = [ - '/headers/original/missing.png', // Mastodon - '/images/banner.png', // Pleroma '/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 ]; @@ -41,10 +42,10 @@ const isDefaultHeader = (url: string) => DEFAULT_HEADERS.some(header => url.ends /** Default avatar filenames from various backends */ 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 - '/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 ];