Skip to content

Commit

Permalink
If a user does not have an profile image, show Steam's default image
Browse files Browse the repository at this point in the history
  • Loading branch information
HilliamT committed Jan 2, 2021
1 parent 9883dd0 commit 1507ef9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app/screens/AccountScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,9 @@ export default function AccountScreen(props) {
}

function getAvatarURL(hash) {
// Use default image if they don't have one
if (hash == null) return "https://cdn.cloudflare.steamstatic.com/steamcommunity/public/images/avatars/fe/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_full.jpg";

// Show the image they are used
return "http://cdn.akamai.steamstatic.com/steamcommunity/public/images/avatars/" + hash?.substr(0, 2) + "/" + hash + "_full.jpg";
}

0 comments on commit 1507ef9

Please sign in to comment.