decord/source/modules/game_profile/hooks/useShouldOpenGameProfileModal.tsx

140 lines
5.2 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 9162
// Function ID: 9163
2026-07-29 08:29:29 +00:00
// Name: useShouldOpenGameProfileModal
2026-08-05 07:35:12 +00:00
// Dependencies: [19, 4276, 676, 698, 1384, 9163, 4787, 9164, 38, 2]
2026-07-29 08:29:29 +00:00
// Exports: default, gameIdIsAcceptable, gameIsAcceptable
2026-07-20 16:05:17 +00:00
2026-08-05 07:35:12 +00:00
// Module 9162 (useShouldOpenGameProfileModal)
2026-07-29 08:29:29 +00:00
import noop from "noop";
2026-08-04 08:36:32 +00:00
import handleLoadMessages from "handleLoadMessages";
2026-07-23 10:11:24 +00:00
import { AnalyticEvents } from "ME";
const require = arg1;
2026-07-20 16:05:17 +00:00
let closure_7 = { NoMatch: "no match", NSFW: "nsfw", Disabled: "profile disabled" };
2026-07-23 10:11:24 +00:00
const result = require("ME").fileFinishedImporting("modules/game_profile/hooks/useShouldOpenGameProfileModal.tsx");
2026-07-20 16:05:17 +00:00
export default function useShouldOpenGameProfileModal(applicationId) {
let gameId;
let trackEntryPointImpression;
let str = applicationId.applicationId;
if (str === undefined) {
str = "";
}
const source = applicationId.source;
({ trackEntryPointImpression, gameId } = applicationId);
if (trackEntryPointImpression === undefined) {
trackEntryPointImpression = true;
}
2026-07-29 08:29:29 +00:00
let importAll;
2026-07-23 10:11:24 +00:00
let gameRecord;
let isLoading;
let shouldOpenGameProfile;
2026-07-29 08:29:29 +00:00
importAll = isLoading.useRef(false);
gameId = trackEntryPointImpression(gameRecord[7])({ applicationId: str, gameId });
2026-07-23 10:11:24 +00:00
gameRecord = gameId.gameRecord;
isLoading = gameId.isLoading;
2026-07-29 08:29:29 +00:00
if (null == gameRecord) {
let items = [closure_7.NoMatch];
let arr = items;
} else {
let items1 = [];
if (obj3.hasFlag(gameRecord.gameFlags, source(tmp[5]).GameFlags.GAME_PROFILE_DISABLED)) {
arr = items1.push(closure_7.Disabled);
}
obj3 = importAll(tmp[4]);
const tmp11 = source;
arr = items1;
if (tmp11Result.isAgeRestrictedContentClassification(gameRecord.contentClassification)) {
arr = items1.push(closure_7.NSFW);
arr = items1;
}
tmp11Result = source(tmp[6]);
}
shouldOpenGameProfile = 0 === arr.length;
const items2 = [gameRecord, shouldOpenGameProfile, isLoading, source, trackEntryPointImpression];
2026-07-23 10:11:24 +00:00
const effect = isLoading.useEffect(() => {
2026-07-20 16:05:17 +00:00
if (!ref.current) {
if (trackEntryPointImpression) {
if (!isLoading) {
2026-07-29 08:29:29 +00:00
let trackResult = gameRecord;
2026-07-20 16:05:17 +00:00
if (null != gameRecord) {
2026-07-29 08:29:29 +00:00
let track = trackEntryPointImpression;
let GAME_PROFILE_ENTRY_POINT_AVAILABLE = gameRecord;
2026-07-20 16:05:17 +00:00
trackEntryPointImpression(gameRecord[8])(null != source, "Cannot track a Game Profile Entry Point Impressions without a source.");
2026-07-29 08:29:29 +00:00
if (null == trackResult) {
const items = [outer1_7.NoMatch];
let tmp8 = items;
} else {
const items1 = [];
if (obj3.hasFlag(trackResult.gameFlags, source(GAME_PROFILE_ENTRY_POINT_AVAILABLE[5]).GameFlags.GAME_PROFILE_DISABLED)) {
items1.push(outer1_7.Disabled);
}
obj3 = ref(GAME_PROFILE_ENTRY_POINT_AVAILABLE[4]);
const tmp18 = source;
tmp8 = items1;
if (tmp18Result.isAgeRestrictedContentClassification(trackResult.contentClassification)) {
items1.push(outer1_7.NSFW);
tmp8 = items1;
}
tmp18Result = source(GAME_PROFILE_ENTRY_POINT_AVAILABLE[6]);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
trackResult = track(GAME_PROFILE_ENTRY_POINT_AVAILABLE[3]);
track = trackResult.track;
GAME_PROFILE_ENTRY_POINT_AVAILABLE = outer1_6.GAME_PROFILE_ENTRY_POINT_AVAILABLE;
const obj = { game_profile_available: null, application_id: null, rejection_reason: null, source: null };
obj[0] = shouldOpenGameProfile;
obj[1] = trackResult.id;
obj[2] = tmp8;
obj[3] = source;
track(GAME_PROFILE_ENTRY_POINT_AVAILABLE, obj);
tmp.current = true;
const tmp15 = source;
2026-07-20 16:05:17 +00:00
}
}
}
}
2026-07-29 08:29:29 +00:00
}, items2);
2026-07-20 16:05:17 +00:00
return { shouldOpenGameProfile, gameId: gameId.gameId };
};
2026-07-29 08:29:29 +00:00
export const gameIsAcceptable = function gameIsAcceptable(gameFlags) {
if (null == gameFlags) {
const items = [closure_7.NoMatch];
let arr = items;
} else {
const items1 = [];
2026-08-05 07:35:12 +00:00
if (obj2.hasFlag(gameFlags.gameFlags, require(9163) /* GameFlags */.GameFlags.GAME_PROFILE_DISABLED)) {
2026-07-29 08:29:29 +00:00
arr = items1.push(closure_7.Disabled);
}
obj2 = importAll(1384);
const tmp8 = require;
arr = items1;
if (tmp8Result.isAgeRestrictedContentClassification(gameFlags.contentClassification)) {
arr = items1.push(closure_7.NSFW);
arr = items1;
}
2026-08-05 07:35:12 +00:00
tmp8Result = require(4787) /* isAgeRestrictedContentClassification */;
2026-07-29 08:29:29 +00:00
}
return 0 === arr.length;
};
2026-08-05 07:35:12 +00:00
export const gameIdIsAcceptable = function gameIdIsAcceptable(closure_0) {
game = game.getGame(closure_0);
2026-07-29 08:29:29 +00:00
if (null == game) {
const items = [closure_7.NoMatch];
let arr = items;
} else {
const items1 = [];
2026-08-05 07:35:12 +00:00
if (obj2.hasFlag(game.gameFlags, require(9163) /* GameFlags */.GameFlags.GAME_PROFILE_DISABLED)) {
2026-07-29 08:29:29 +00:00
arr = items1.push(closure_7.Disabled);
}
obj2 = importAll(1384);
const tmp9 = require;
arr = items1;
if (tmp9Result.isAgeRestrictedContentClassification(game.contentClassification)) {
arr = items1.push(closure_7.NSFW);
arr = items1;
}
2026-08-05 07:35:12 +00:00
tmp9Result = require(4787) /* isAgeRestrictedContentClassification */;
2026-07-29 08:29:29 +00:00
}
return 0 === arr.length;
2026-07-20 16:05:17 +00:00
};