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

53 lines
2 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 9389
// Function ID: 9390
2026-08-08 06:10:11 +00:00
// Name: useGetGameForAppId
2026-08-25 06:04:03 +00:00
// Dependencies: [19, 4404, 5840, 6033, 1370, 589, 2]
2026-08-08 06:10:11 +00:00
// Exports: default, useGetGamesForAppIds
2026-08-25 06:04:03 +00:00
// Module 9389 (useGetGameForAppId)
import useGetOrFetchApplications from "useGetOrFetchApplications" /* 5840 */;
import importDefaultResult1 from "importDefaultResult1" /* 6033 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "noop" /* 19 */;
2026-08-25 06:04:03 +00:00
import closure_4 from "handleLoadMessages" /* 4404 */;
2026-08-08 06:10:11 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
const result = require("set").fileFinishedImporting("modules/games/hooks/useGetGameForAppId.tsx");
2026-08-08 06:10:11 +00:00
export default function useGetGameForAppId(applicationId) {
2026-08-24 06:08:38 +00:00
let obj = useGetOrFetchApplications;
2026-08-08 06:10:11 +00:00
const getOrFetchApplication = obj.useGetOrFetchApplication(applicationId);
let canonicalGameId;
if (getOrFetchApplication != null) {
canonicalGameId = getOrFetchApplication.getCanonicalGameId();
}
if (canonicalGameId == null) {
canonicalGameId = null;
}
2026-08-24 06:08:38 +00:00
const game = importDefaultResult1.useGame(canonicalGameId);
2026-08-08 06:10:11 +00:00
let data = game.data;
obj = { gameId: canonicalGameId, gameRecord: null, isLoading: null };
if (data == null) {
data = null;
}
obj[1] = data;
obj[2] = null != applicationId && null == getOrFetchApplication || game.isLoading;
return obj;
};
export const useGetGamesForAppIds = function useGetGamesForAppIds(stateFromStoresArray) {
2026-08-25 06:04:03 +00:00
const tmp = memo(5840)(stateFromStoresArray);
2026-08-24 06:08:38 +00:00
const _require = tmp;
2026-08-08 06:10:11 +00:00
const items = [tmp];
memo = React.useMemo(() => {
2026-08-24 06:08:38 +00:00
const found = lib.filter(lib(closure_1_2[4]).isNotNullish);
2026-08-08 06:10:11 +00:00
const mapped = found.map((getCanonicalGameId) => getCanonicalGameId.getCanonicalGameId());
2026-08-24 06:08:38 +00:00
return mapped.filter(lib(closure_1_2[4]).isNotNullish);
2026-08-08 06:10:11 +00:00
}, items);
2026-08-25 06:04:03 +00:00
const games = _require(6033).useGames(memo);
const obj = _require(6033);
2026-08-24 06:08:38 +00:00
const items1 = [closure_4];
return _require(589).useStateFromStoresArray(items1, () => {
2026-08-08 06:10:11 +00:00
const mapped = memo.map((closure_0) => game.getGame(closure_0));
2026-08-24 06:08:38 +00:00
return mapped.filter(lib(closure_1_2[4]).isNotNullish);
2026-08-08 06:10:11 +00:00
});
};