Merge pull request #1012 from hydralauncher/chore/update-steam-games
Some checks are pending
Release / build (ubuntu-latest) (push) Waiting to run
Release / build (windows-latest) (push) Waiting to run

chore: update steam games
This commit is contained in:
Zamitto 2024-09-23 14:45:02 -03:00 committed by GitHub
commit fabeedaa8a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 20 additions and 9 deletions

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,7 @@ import { useAppSelector, useUserDetails } from "@renderer/hooks";
import { useEffect, useMemo, useRef } from "react";
import { useTranslation } from "react-i18next";
import { UserFriendModalTab } from "@renderer/pages/shared-modals/user-friend-modal";
import SteamLogo from "@renderer/assets/steam-logo.svg?react";
const LONG_POLLING_INTERVAL = 60_000;
@ -68,6 +69,23 @@ export function SidebarProfile() {
);
}, [userDetails, t, friendRequestCount, showFriendsModal]);
const gameRunningDetails = () => {
if (!userDetails || !gameRunning) return null;
if (gameRunning.iconUrl) {
return (
<img
alt={gameRunning.title}
width={24}
style={{ borderRadius: 4 }}
src={gameRunning.iconUrl}
/>
);
}
return <SteamLogo />;
};
return (
<div className={styles.profileContainer}>
<button
@ -108,14 +126,7 @@ export function SidebarProfile() {
)}
</div>
{userDetails && gameRunning && (
<img
alt={gameRunning.title}
width={24}
style={{ borderRadius: 4 }}
src={gameRunning.iconUrl!}
/>
)}
{gameRunningDetails()}
</div>
</button>