]> git.localhorst.tv Git - alttp.git/commitdiff
add default avatar
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Sun, 13 Mar 2022 20:20:55 +0000 (21:20 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Sun, 13 Mar 2022 20:20:55 +0000 (21:20 +0100)
public/default-avatar.png [new file with mode: 0644]
resources/js/helpers/User.js

diff --git a/public/default-avatar.png b/public/default-avatar.png
new file mode 100644 (file)
index 0000000..db3ddd8
Binary files /dev/null and b/public/default-avatar.png differ
index 2a36a39422c7f707d0bc97c0ac57c0c74cea55d7..8aa839d732fbb174f8b599031de8853baa5a946f 100644 (file)
@@ -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;