diff --git a/src/main/events/profile/get-user-profile.ts b/src/main/events/profile/get-user-profile.ts index 6f2179ef..0e16b03b 100644 --- a/src/main/events/profile/get-user-profile.ts +++ b/src/main/events/profile/get-user-profile.ts @@ -5,6 +5,7 @@ import { HydraApi } from "@main/services/hydra-api"; import { steamGamesWorker } from "@main/workers"; import { UserProfile } from "@types"; import { convertSteamGameToCatalogueEntry } from "../helpers/search-games"; +import { getSteamAppAsset } from "@main/helpers"; const getUserProfile = async ( _event: Electron.IpcMainInvokeEvent, @@ -19,8 +20,11 @@ const getUserProfile = async ( const steamGame = await steamGamesWorker.run(Number(game.objectId), { name: "getById", }); + const iconUrl = steamGame?.clientIcon + ? getSteamAppAsset("icon", game.objectId, steamGame.clientIcon) + : null; - return convertSteamGameToCatalogueEntry(steamGame); + return { ...convertSteamGameToCatalogueEntry(steamGame), iconUrl }; }) ); @@ -29,7 +33,11 @@ const getUserProfile = async ( const steamGame = await steamGamesWorker.run(Number(game.objectId), { name: "getById", }); - return convertSteamGameToCatalogueEntry(steamGame); + const iconUrl = steamGame?.clientIcon + ? getSteamAppAsset("icon", game.objectId, steamGame.clientIcon) + : null; + + return { ...convertSteamGameToCatalogueEntry(steamGame), iconUrl }; }) ); diff --git a/src/renderer/src/pages/profile/profile-content.tsx b/src/renderer/src/pages/profile/profile-content.tsx index e8081b7f..1907a3b8 100644 --- a/src/renderer/src/pages/profile/profile-content.tsx +++ b/src/renderer/src/pages/profile/profile-content.tsx @@ -1,4 +1,5 @@ import { UserProfile } from "@types"; +import cn from "classnames"; import * as styles from "./profile.css"; import { SPACING_UNIT, vars } from "@renderer/theme.css"; @@ -22,7 +23,7 @@ export const ProfileContent = ({ userProfile }: ProfileContentProps) => {