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

53 lines
2 KiB
TypeScript
Raw Normal View History

2026-09-03 10:05:34 +00:00
// Module ID: 9896
// Function ID: 9897
2026-08-08 06:10:11 +00:00
// Name: useGetGameForAppId
2026-09-03 10:05:34 +00:00
// Dependencies: [19, 4502, 5968, 6163, 1470, 586, 2]
2026-08-08 06:10:11 +00:00
// Exports: default, useGetGamesForAppIds
2026-09-03 10:05:34 +00:00
// Module 9896 (useGetGameForAppId)
import useGetOrFetchApplications from "useGetOrFetchApplications" /* 5968 */;
import importDefaultResult1 from "importDefaultResult1" /* 6163 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "noop" /* 19 */;
2026-09-01 10:26:29 +00:00
import closure_4 from "handleLoadMessages" /* 4502 */;
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-09-03 10:05:34 +00:00
const tmp = memo(5968)(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-09-03 10:05:34 +00:00
const games = _require(6163).useGames(memo);
const obj = _require(6163);
2026-08-24 06:08:38 +00:00
const items1 = [closure_4];
2026-09-02 09:53:35 +00:00
return _require(586).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
});
};