decord/source/modules/games/hooks/useResolveGame.tsx

47 lines
1.3 KiB
TypeScript
Raw Normal View History

2026-07-23 10:11:24 +00:00
// Module ID: 8593
// Function ID: 68210
2026-07-20 16:05:17 +00:00
// Name: useResolveGame
2026-07-23 10:11:24 +00:00
// Dependencies: [31, 5470, 6865, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-23 10:11:24 +00:00
// Module 8593 (useResolveGame)
import result from "result";
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
const require = arg1;
const result = require("importDefaultResult1").fileFinishedImporting("modules/games/hooks/useResolveGame.tsx");
2026-07-20 16:05:17 +00:00
export default function useResolveGame(arg0) {
let applicationId;
let gameId;
({ applicationId, gameId } = arg0);
2026-07-23 10:11:24 +00:00
let getOrFetchApplication;
let obj = gameId(getOrFetchApplication[1]);
2026-07-20 16:05:17 +00:00
let tmp;
if (null == gameId) {
tmp = applicationId;
}
2026-07-23 10:11:24 +00:00
getOrFetchApplication = obj.useGetOrFetchApplication(tmp);
2026-07-20 16:05:17 +00:00
const items = [gameId, getOrFetchApplication];
const memo = React.useMemo(() => {
if (null != gameId) {
let canonicalGameId = gameId;
} else {
canonicalGameId = null;
if (null != getOrFetchApplication) {
canonicalGameId = getOrFetchApplication.getCanonicalGameId();
}
}
return canonicalGameId;
}, items);
2026-07-23 10:11:24 +00:00
const game = gameId(getOrFetchApplication[2]).useGame(memo);
2026-07-20 16:05:17 +00:00
const data = game.data;
obj = { gameId: memo };
let tmp5 = null;
if (null != data) {
tmp5 = data;
}
obj.gameRecord = tmp5;
obj.isLoading = null == gameId && null != applicationId && null == getOrFetchApplication || game.isLoading;
return obj;
};