diff --git a/frontend/src/lib/api/entities.ts b/frontend/src/lib/api/entities.ts index 8683a58..9a8746b 100644 --- a/frontend/src/lib/api/entities.ts +++ b/frontend/src/lib/api/entities.ts @@ -153,19 +153,24 @@ export const pronounDisplay = (entry: Pronoun) => { }; export const userAvatars = (user: User | MeUser | MemberPartialUser) => { - if (!user.avatar) return []; + if (!user.avatar) return defaultAvatars; return [ `${PUBLIC_BASE_URL}/media/users/${user.id}/${user.avatar}.webp`, - `${PUBLIC_BASE_URL}/media/users/${user.id}/${user.avatar}.webp`, + `${PUBLIC_BASE_URL}/media/users/${user.id}/${user.avatar}.jpg`, ]; }; export const memberAvatars = (member: Member | PartialMember) => { - if (!member.avatar) return []; + if (!member.avatar) return defaultAvatars; return [ `${PUBLIC_BASE_URL}/media/members/${member.id}/${member.avatar}.webp`, - `${PUBLIC_BASE_URL}/media/members/${member.id}/${member.avatar}.webp`, + `${PUBLIC_BASE_URL}/media/members/${member.id}/${member.avatar}.jpg`, ]; }; + +export const defaultAvatars = [ + `${PUBLIC_BASE_URL}/default/512.webp`, + `${PUBLIC_BASE_URL}/default/512.jpg`, +]; diff --git a/frontend/src/lib/components/FallbackImage.svelte b/frontend/src/lib/components/FallbackImage.svelte index e5d3c52..cae5740 100644 --- a/frontend/src/lib/components/FallbackImage.svelte +++ b/frontend/src/lib/components/FallbackImage.svelte @@ -1,4 +1,6 @@ {#if urls.length > 0} @@ -21,9 +25,8 @@ {#each urls as url} {/each} - + {:else} - - + {/if} diff --git a/frontend/static/default/512.jpg b/frontend/static/default/512.jpg new file mode 100644 index 0000000..f41db5d Binary files /dev/null and b/frontend/static/default/512.jpg differ diff --git a/frontend/static/default/512.webp b/frontend/static/default/512.webp new file mode 100644 index 0000000..3701f7d Binary files /dev/null and b/frontend/static/default/512.webp differ