decord/source/modules/games/hooks/useResolveGame.tsx
github-actions 777dc50a28 chore: update source for alpha 346.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4790.js (118.4 MB)
2026-09-10 19:12:31 +00:00

46 lines
1.4 KiB
TypeScript

// Module ID: 8749
// Function ID: 8750
// Name: useResolveGame
// Dependencies: [19, 7220, 7361, 2]
// Exports: default
// Module 8749 (useResolveGame)
import useGetOrFetchApplications from "useGetOrFetchApplications" /* 7220 */;
import useGame from "useGame" /* 7361 */;
import noop from "module_19" /* 19 */;
require = fn;
const size = fn(2);
const result = size.fileFinishedImporting("modules/games/hooks/useResolveGame.tsx");
export default function useResolveGame(arg0) {
({ applicationId, gameId } = arg0);
let getOrFetchApplication;
let tmp3;
if (null == gameId) {
tmp3 = applicationId;
}
getOrFetchApplication = useGetOrFetchApplications.useGetOrFetchApplication(tmp3);
const items = [gameId, getOrFetchApplication];
const memo = noop.useMemo(() => {
let tmp = gameId;
if (null == gameId) {
let canonicalGameId = null;
if (null != getOrFetchApplication) {
canonicalGameId = obj.getCanonicalGameId();
}
tmp = canonicalGameId;
obj = getOrFetchApplication;
}
return tmp;
}, items);
const game = useGame.useGame(memo);
let data = game.data;
const obj2 = { gameId: memo, gameRecord: null, isLoading: null };
if (data == null) {
data = null;
}
obj2.gameRecord = data;
obj2.isLoading = null == gameId && null != applicationId && null == getOrFetchApplication || game.isLoading;
return obj2;
};