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

107 lines
3.3 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 8864
// Function ID: 8865
2026-07-20 16:05:17 +00:00
// Name: useResolveGame
2026-10-09 10:00:15 +00:00
// Dependencies: [19, 558, 576, 6854, 7002, 2]
2026-07-20 16:05:17 +00:00
2026-10-09 10:00:15 +00:00
// Module 8864 (useResolveGame)
2026-10-03 08:58:59 +00:00
import react2 from "react" /* 576 */;
2026-10-09 10:00:15 +00:00
import useGetOrFetchApplications from "useGetOrFetchApplications" /* 6854 */;
2026-10-03 08:58:59 +00:00
import react from "react" /* 19 */;
import ReactCompilerGating from "ReactCompilerGating" /* 558 */;
import size from "module_2" /* 2 */;
2026-07-20 16:05:17 +00:00
2026-10-03 08:58:59 +00:00
let tmp;
2026-10-09 10:00:15 +00:00
const useGame = tmp(7002);
2026-10-08 09:57:35 +00:00
const tmp2 = ReactCompilerGating.isReactCompilerEnabled() ? (function useResolveGame(arg0) {
2026-10-03 08:58:59 +00:00
let applicationId;
let data;
let gameId;
let isLoading;
const obj = react2;
const cResult = obj.c(6);
({ applicationId, gameId } = arg0);
let tmp5;
const useGetOrFetchApplication = useGetOrFetchApplications.useGetOrFetchApplication;
useGetOrFetchApplications;
if (null == gameId) {
tmp5 = applicationId;
}
const getOrFetchApplication = useGetOrFetchApplication(tmp5);
let tmp6 = gameId;
if (null == gameId) {
tmp6 = null;
if (null != getOrFetchApplication) {
let tmp7;
if (cResult[0] !== getOrFetchApplication) {
const canonicalGameId = getOrFetchApplication.getCanonicalGameId();
cResult[0] = getOrFetchApplication;
cResult[1] = canonicalGameId;
tmp7 = canonicalGameId;
} else {
tmp7 = cResult[1];
}
tmp6 = tmp7;
}
}
const tmpResult = useGame;
const game = tmpResult.useGame(tmp6);
({ data, isLoading } = game);
if (data == null) {
data = null;
}
if (cResult[2] === tmp6) {
if (cResult[3] === data) {
let tmp11;
if (cResult[4] === (null == gameId && null != applicationId && null == getOrFetchApplication || isLoading)) {
tmp11 = cResult[5];
}
return tmp11;
}
}
const obj2 = { gameId: tmp6, gameRecord: data, isLoading: null == gameId && null != applicationId && null == getOrFetchApplication || isLoading };
cResult[2] = tmp6;
cResult[3] = data;
cResult[4] = null == gameId && null != applicationId && null == getOrFetchApplication || isLoading;
cResult[5] = obj2;
tmp11 = obj2;
2026-10-08 09:57:35 +00:00
}) : (function useResolveGame(arg0) {
2026-10-03 08:58:59 +00:00
let applicationId;
let gameId;
let isLoading;
2026-07-20 16:05:17 +00:00
({ applicationId, gameId } = arg0);
2026-07-23 10:11:24 +00:00
let getOrFetchApplication;
2026-10-03 08:58:59 +00:00
let tmp = require;
let tmp4;
const useGetOrFetchApplication = useGetOrFetchApplications.useGetOrFetchApplication;
useGetOrFetchApplications;
2026-07-20 16:05:17 +00:00
if (null == gameId) {
2026-10-03 08:58:59 +00:00
tmp4 = applicationId;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
getOrFetchApplication = useGetOrFetchApplication(tmp4);
2026-07-20 16:05:17 +00:00
const items = [gameId, getOrFetchApplication];
2026-10-03 08:58:59 +00:00
const memo = react.useMemo(() => {
2026-07-29 08:29:29 +00:00
let tmp = gameId;
if (null == gameId) {
let canonicalGameId = null;
2026-10-03 08:58:59 +00:00
const obj = getOrFetchApplication;
2026-07-20 16:05:17 +00:00
if (null != getOrFetchApplication) {
2026-07-29 08:29:29 +00:00
canonicalGameId = obj.getCanonicalGameId();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp = canonicalGameId;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp;
2026-07-20 16:05:17 +00:00
}, items);
2026-10-03 08:58:59 +00:00
const tmpResult = useGame;
const game = tmpResult.useGame(memo);
2026-07-29 08:29:29 +00:00
let data = game.data;
2026-10-03 08:58:59 +00:00
let obj = { gameId: memo, gameRecord: data, isLoading: null == gameId && null != applicationId && null == getOrFetchApplication || isLoading };
isLoading = game.isLoading;
2026-07-29 08:29:29 +00:00
if (data == null) {
data = null;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
return obj;
});
const result = size.fileFinishedImporting("modules/games/hooks/useResolveGame.tsx");
export default tmp2;