Skip to content

Commit

Permalink
Fix Avatar URL generation bug (#2063)
Browse files Browse the repository at this point in the history
  • Loading branch information
devsnek authored and amishshah committed Oct 26, 2017
1 parent cd08a3b commit bc30fdd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/util/Constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ exports.Endpoints = {
Asset: name => `${root}/assets/${name}`,
DefaultAvatar: number => `${root}/embed/avatars/${number}.png`,
Avatar: (userID, hash, format = 'default', size) => {
if (userID === '1') return hash;
if (format === 'default') format = hash.startsWith('a_') ? 'gif' : 'webp';
return makeImageUrl(`${root}/avatars/${userID}/${hash}`, { format, size });
},
Expand Down

0 comments on commit bc30fdd

Please sign in to comment.