Files
discord-decomp/modules/game_profile/hooks/useResolveGameForProfile.tsx
T
2026-11-01 12:12:55 +02:00

34 lines
1.2 KiB
TypeScript

// Metro module 8478 (f8479).
import { useGetOrFetchApplication } from "../../applications/useGetOrFetchApplications";
import { isRobloxSubgameApplication, isRobloxSubgameGame } from "../../roblox_subgame_detection/RobloxSubgameUtils";
import useResolveGame from "../../games/hooks/useResolveGame";
import { ROBLOX_GAME_ID } from "../../roblox_subgame_detection/RobloxSubgameTypes";
import { useGame } from "../../games/hooks/useGame";
export default function useResolveGameForProfile(a0) {
const applicationId = a0.applicationId;
let gameId = a0.gameId;
const getOrFetchApplication = useGetOrFetchApplication(gameId == null ? applicationId : void 0);
if (getOrFetchApplication != null && isRobloxSubgameApplication(getOrFetchApplication)) {
gameId = ROBLOX_GAME_ID;
}
let r24 = useResolveGame({
applicationId,
gameId
});
const r26 = r24.gameRecord != null && isRobloxSubgameGame(r24.gameRecord);
const game = useGame(r26 ? ROBLOX_GAME_ID : void 0);
let data = game.data;
const isLoading = game.isLoading;
if (r26) {
if (data == null) {
data = null;
}
r24 = {
gameId: ROBLOX_GAME_ID,
gameRecord: data,
isLoading
};
}
return r24;
};