This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

+55
View File
@@ -0,0 +1,55 @@
// Metro module 5906 (f5907).
import { useEffect } from "react";
import GameStore from "../GameStore";
import { QueryIds } from "../../../Constants";
import * as _Module589 from "../../../_bundle/Module589";
import { createFetchStore } from "../../../_bundle/Module589";
import Durations from "../../../utils/Durations";
import { fetchGamesWithSupplementalData } from "../GameActionCreators";
let c3698_2, fetchStore;
const r27 = {
getQueryId: QueryIds.GAME,
failureStaleAfter: 15 * Durations.Seconds.SECOND,
get: (a0) => {
let NO_DATA;
const r1 = a0 == null;
let r2 = null;
if (!r1) {
if (GameStore.hasNoData(a0)) {
NO_DATA = _Module589.NO_DATA;
} else {
NO_DATA = GameStore.getGame(a0);
if (NO_DATA == null) {
NO_DATA = null;
}
}
r2 = NO_DATA;
}
return r2;
},
load: null,
getIsLoading: null,
getError: null
};
c3698_2 = async (c15261_0) => {
L11: {
if (c15261_0 != null) {
await fetchGamesWithSupplementalData([c15261_0]);
break L11;
}
return void 0;
}
};
r27.load = function() {
const apply = c3698_2.apply;
return c3698_2.apply(this, arguments);
};
r27.getIsLoading = (a0) => a0 != null && GameStore.isFetching(a0);
r27.getError = (a0) => a0 != null ? GameStore.didFetchingFail(a0) ? new Error("Failed to fetch game data") : null : null;
fetchStore = createFetchStore(GameStore, r27);
export { fetchStore as useGame };
export function useGames(a0) {
useEffect(() => {
fetchStore.fetchMany.apply(fetchStore, [...a0.map((item) => [item])]);
}, [a0]);
}
@@ -0,0 +1,20 @@
// Metro module 12063 (f12064).
import { useGame } from "./useGame";
import { intl, t } from "../../../intl/index.native";
export default function useGameNameAndCoverImage(a0, a1, a2) {
const game = useGame(a0);
const { data, isLoading } = game;
const coverImageUrl = data == null ? void 0 : data.getCoverURL(a2);
let gameName = data?.name;
if (gameName == null) {
gameName = a1;
}
if (gameName == null) {
gameName = intl.string(t.GIWFlF);
}
return {
coverImageUrl,
gameName,
isLoading
};
};
+25
View File
@@ -0,0 +1,25 @@
// Metro module 8479 (f8480).
import { useMemo } from "react";
import { useGetOrFetchApplication } from "../../applications/useGetOrFetchApplications";
import { useGame } from "./useGame";
export default function useResolveGame({ applicationId, gameId }) {
const getOrFetchApplication = useGetOrFetchApplication(gameId == null ? applicationId : void 0);
const memo = useMemo(() => {
let r1 = gameId;
if (gameId == null) {
r1 = getOrFetchApplication == null ? null : getOrFetchApplication.getCanonicalGameId();
}
return r1;
}, [gameId, getOrFetchApplication]);
const game = useGame(memo);
let data = game.data;
const isLoading = game.isLoading;
if (data == null) {
data = null;
}
return {
gameId: memo,
gameRecord: data,
isLoading: gameId == null && applicationId != null && getOrFetchApplication == null || isLoading
};
};