Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4973.js (118.4 MB)
46 lines
1.4 KiB
TypeScript
46 lines
1.4 KiB
TypeScript
// Module ID: 8982
|
|
// Function ID: 8983
|
|
// Name: useResolveGame
|
|
// Dependencies: [19, 7445, 7583, 2]
|
|
// Exports: default
|
|
|
|
// Module 8982 (useResolveGame)
|
|
import useGetOrFetchApplications from "useGetOrFetchApplications" /* 7445 */;
|
|
import useGame from "useGame" /* 7583 */;
|
|
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;
|
|
};
|