From: Daniel Karbach Date: Sun, 13 Mar 2022 20:20:55 +0000 (+0100) Subject: add default avatar X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=b115fcfcad6c2798cffad9a166c4886cfe1eed6f;p=alttp.git add default avatar --- diff --git a/public/default-avatar.png b/public/default-avatar.png new file mode 100644 index 0000000..db3ddd8 Binary files /dev/null and b/public/default-avatar.png differ diff --git a/resources/js/helpers/User.js b/resources/js/helpers/User.js index 2a36a39..8aa839d 100644 --- a/resources/js/helpers/User.js +++ b/resources/js/helpers/User.js @@ -1,4 +1,6 @@ -export const getAvatarUrl = user => `//cdn.discordapp.com/avatars/${user.id}/${user.avatar}.png`; +export const getAvatarUrl = user => (user.avatar + ? `//cdn.discordapp.com/avatars/${user.id}/${user.avatar}.png` + : '/default-avatar.png'); export const findResult = (user, round) => { if (!user || !user.id) return null;