decord/source/modules/game_mentions/hooks/useGameMentionData.tsx

80 lines
2.6 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 6936
// Function ID: 6937
2026-08-05 07:35:12 +00:00
// Name: getGameMentionData
2026-08-24 06:08:38 +00:00
// Dependencies: [4509, 6937, 1922, 6939, 589, 643, 2]
2026-08-05 07:35:12 +00:00
// Exports: getGameMentionData, useGameMentionData
2026-08-24 06:08:38 +00:00
// Module 6936 (getGameMentionData)
import shallowEqualDefault from "shallowEqual" /* 643 */;
import useGameProfileObscured from "useGameProfileObscured" /* 6939 */;
import closure_3 from "handleLoadMessages" /* 4509 */;
import closure_4 from "set" /* 6937 */;
import closure_5 from "mergeGuildAvatar" /* 1922 */;
2026-08-05 07:35:12 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
const result = require("set").fileFinishedImporting("modules/game_mentions/hooks/useGameMentionData.tsx");
2026-08-05 07:35:12 +00:00
export const getGameMentionData = function getGameMentionData(closure_0) {
currentUser = currentUser.getCurrentUser();
game = game.getGame(closure_0);
gameById = gameById.getGameById(closure_0);
if (null != game) {
let nsfwAllowed;
if (currentUser != null) {
nsfwAllowed = currentUser.nsfwAllowed;
}
if (!obj2.isGameProfileObscured(game, nsfwAllowed)) {
let obj = { gameId: null, gameName: null, gameIcon: null };
obj[0] = closure_0;
({ name: obj3[1], media } = game);
let icon;
if (media != null) {
icon = media.icon;
}
obj[2] = icon;
let tmp4 = obj;
}
2026-08-24 06:08:38 +00:00
obj2 = useGameProfileObscured;
2026-08-05 07:35:12 +00:00
} else if (null != gameById) {
obj = { gameId: null, gameName: null, gameIcon: null };
obj[0] = closure_0;
({ name: obj[1], icon: obj[2] } = gameById);
tmp4 = obj;
}
return tmp4;
};
export const useGameMentionData = function useGameMentionData(gameId) {
const _require = gameId;
2026-08-24 06:08:38 +00:00
const items = [closure_3, closure_4, closure_5];
2026-08-05 07:35:12 +00:00
const items1 = [gameId];
return _require(589).useStateFromStores(items, () => {
2026-08-24 06:08:38 +00:00
const currentUser = closure_1_5.getCurrentUser();
const game = closure_1_3.getGame(gameId);
const gameById = closure_1_4.getGameById(gameId);
2026-08-05 07:35:12 +00:00
if (null != game) {
let nsfwAllowed;
if (currentUser != null) {
nsfwAllowed = currentUser.nsfwAllowed;
}
if (!obj2.isGameProfileObscured(game, nsfwAllowed)) {
let obj = { gameId: null, gameName: null, gameIcon: null };
obj[0] = tmp;
({ name: obj3[1], media } = game);
let icon;
if (media != null) {
icon = media.icon;
}
obj[2] = icon;
let tmp5 = obj;
}
2026-08-24 06:08:38 +00:00
obj2 = gameId(closure_1_2[3]);
2026-08-05 07:35:12 +00:00
} else if (null != gameById) {
obj = { gameId: null, gameName: null, gameIcon: null };
obj[0] = tmp;
({ name: obj[1], icon: obj[2] } = gameById);
tmp5 = obj;
}
return tmp5;
2026-08-24 06:08:38 +00:00
}, items1, shallowEqualDefault);
2026-08-05 07:35:12 +00:00
};