mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-02 16:23:48 +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 { useEffect, useMemo, useRef } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { UserFriendModalTab } from "@renderer/pages/shared-modals/user-friend-modal";
|
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;
|
const LONG_POLLING_INTERVAL = 60_000;
|
||||||
|
|
||||||
@ -68,6 +69,23 @@ export function SidebarProfile() {
|
|||||||
);
|
);
|
||||||
}, [userDetails, t, friendRequestCount, showFriendsModal]);
|
}, [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 (
|
return (
|
||||||
<div className={styles.profileContainer}>
|
<div className={styles.profileContainer}>
|
||||||
<button
|
<button
|
||||||
@ -108,14 +126,7 @@ export function SidebarProfile() {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{userDetails && gameRunning && (
|
{gameRunningDetails()}
|
||||||
<img
|
|
||||||
alt={gameRunning.title}
|
|
||||||
width={24}
|
|
||||||
style={{ borderRadius: 4 }}
|
|
||||||
src={gameRunning.iconUrl!}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user