mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 05:24:55 +03:00
Merge pull request #1012 from hydralauncher/chore/update-steam-games
chore: update steam games
This commit is contained in:
commit
fabeedaa8a
File diff suppressed because one or more lines are too long
@ -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>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user