Fix Game type to resolve typecheck errors

This commit is contained in:
ItsYeBoi20
2025-10-01 06:15:41 +02:00
parent cb9b120093
commit abe2314c38
6 changed files with 152 additions and 14 deletions

View File

@@ -9,6 +9,7 @@ import type {
UserPreferences,
StartGameDownloadPayload,
RealDebridUser,
AllDebridUser,
UserProfile,
FriendRequest,
FriendRequestAction,
@@ -28,7 +29,6 @@ import type {
LibraryGame,
GameRunning,
TorBoxUser,
AllDebridUser,
Theme,
Badge,
Auth,
@@ -113,6 +113,43 @@ declare global {
objectId: string,
title: string
) => Promise<void>;
addCustomGameToLibrary: (
title: string,
executablePath: string,
iconUrl?: string,
logoImageUrl?: string,
libraryHeroImageUrl?: string
) => Promise<Game>;
updateCustomGame: (params: {
shop: GameShop;
objectId: string;
title: string;
iconUrl?: string;
logoImageUrl?: string;
libraryHeroImageUrl?: string;
originalIconPath?: string;
originalLogoPath?: string;
originalHeroPath?: string;
}) => Promise<Game>;
copyCustomGameAsset: (
sourcePath: string,
assetType: "icon" | "logo" | "hero"
) => Promise<string>;
cleanupUnusedAssets: () => Promise<{
deletedCount: number;
errors: string[];
}>;
updateGameCustomAssets: (params: {
shop: GameShop;
objectId: string;
title: string;
customIconUrl?: string | null;
customLogoImageUrl?: string | null;
customHeroImageUrl?: string | null;
customOriginalIconPath?: string | null;
customOriginalLogoPath?: string | null;
customOriginalHeroPath?: string | null;
}) => Promise<Game>;
createGameShortcut: (
shop: GameShop,
objectId: string,
@@ -277,6 +314,8 @@ declare global {
onCommonRedistProgress: (
cb: (value: { log: string; complete: boolean }) => void
) => () => Electron.IpcRenderer;
saveTempFile: (fileName: string, fileData: Uint8Array) => Promise<string>;
deleteTempFile: (filePath: string) => Promise<void>;
platform: NodeJS.Platform;
/* Auto update */

View File

@@ -229,7 +229,7 @@ export function HeroPanelActions() {
{game.favorite ? <HeartFillIcon /> : <HeartIcon />}
</Button>
{userDetails && (
{userDetails && game.shop !== "custom" && (
<Button
onClick={toggleGamePinned}
theme="outline"