Skip to content

Commit

Permalink
fix share code avatar differs from profile avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenKKC committed Sep 11, 2023
1 parent a325f58 commit 2accd01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/UserUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function getDefaultAvatarURL(accountID = '', isNewDot = false) {

// The default avatar for a user is based on a simple hash of their accountID.
// Note that Avatar count starts at 1 which is why 1 has to be added to the result (or else 0 would result in a broken avatar link)
const accountIDHashBucket = hashText(String(accountID), isNewDot ? CONST.DEFAULT_AVATAR_COUNT : CONST.OLD_DEFAULT_AVATAR_COUNT) + 1;
const accountIDHashBucket = (Number(accountID) % (isNewDot ? CONST.DEFAULT_AVATAR_COUNT : CONST.OLD_DEFAULT_AVATAR_COUNT)) + 1;
const avatarPrefix = isNewDot ? `default-avatar` : `avatar`;

return `${CONST.CLOUDFRONT_URL}/images/avatars/${avatarPrefix}_${accountIDHashBucket}.png`;
Expand Down

0 comments on commit 2accd01

Please sign in to comment.