mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
Add new default placeholder avatars
This commit is contained in:
parent
6917def011
commit
e4f82e2fa9
3 changed files with 12 additions and 2 deletions
|
|
@ -34,7 +34,11 @@ export type UserWithRelations = Prisma.UserGetPayload<typeof userRelations2>;
|
|||
* @returns The raw URL for the user's avatar
|
||||
*/
|
||||
export const getAvatarUrl = (user: User, config: Config) => {
|
||||
if (!user.avatar) return config.defaults.avatar;
|
||||
if (!user.avatar)
|
||||
return (
|
||||
config.defaults.avatar ||
|
||||
`https://api.dicebear.com/8.x/${config.defaults.placeholder_style}/svg?seed=${user.username}`
|
||||
);
|
||||
return getUrl(user.avatar, config);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue