From 1507ef939084e638be5e5b46c1b73e2efb0e3321 Mon Sep 17 00:00:00 2001 From: Mengh Date: Sat, 2 Jan 2021 23:03:28 +0000 Subject: [PATCH] If a user does not have an profile image, show Steam's default image --- src/app/screens/AccountScreen.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/screens/AccountScreen.tsx b/src/app/screens/AccountScreen.tsx index 2786ffd..f4bd36c 100644 --- a/src/app/screens/AccountScreen.tsx +++ b/src/app/screens/AccountScreen.tsx @@ -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"; } \ No newline at end of file