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

73 lines
2 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 9204
// Function ID: 9205
2026-07-20 16:05:17 +00:00
// Name: useGameAnnouncements
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 9135, 589, 9205, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 9204 (useGameAnnouncements)
import set from "set" /* 2 */;
import noop from "noop" /* 19 */;
import closure_3 from "getSimilarGames" /* 9135 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
const useEffect = noop.useEffect;
let result = set.fileFinishedImporting("modules/game_profile/hooks/useGameAnnouncements.tsx");
2026-07-20 16:05:17 +00:00
export default function useGameAnnouncements(arg0, arg1) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-08-24 06:08:38 +00:00
dependencyMap = arg1;
2026-07-29 08:29:29 +00:00
let obj = _require(589);
2026-08-24 06:08:38 +00:00
const items = [closure_3];
2026-07-20 16:05:17 +00:00
const stateFromStoresObject = obj.useStateFromStoresObject(items, () => {
let announcements;
2026-07-23 10:11:24 +00:00
if (null != closure_0) {
2026-08-24 06:08:38 +00:00
announcements = closure_1_3.getAnnouncements(tmp);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const obj = { data: announcements, hasFetched: null, isFetching: null };
let result = null != tmp;
2026-07-20 16:05:17 +00:00
if (result) {
2026-08-24 06:08:38 +00:00
result = closure_1_3.hasAnnouncementsBeenFetched(tmp);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[1] = result;
let result1 = null != tmp;
2026-07-20 16:05:17 +00:00
if (result1) {
2026-08-24 06:08:38 +00:00
result1 = closure_1_3.isAnnouncementsFetching(tmp);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[2] = result1;
2026-07-20 16:05:17 +00:00
return obj;
});
({ data, hasFetched } = stateFromStoresObject);
const items1 = [arg0, hasFetched, arg1];
2026-07-23 10:11:24 +00:00
hasFetched(() => {
let result = null == callback || hasFetched;
2026-07-20 16:05:17 +00:00
if (!result) {
2026-08-24 06:08:38 +00:00
result = closure_1_3.isAnnouncementsFetching(tmp);
2026-07-20 16:05:17 +00:00
}
if (!result) {
2026-07-23 10:11:24 +00:00
let obj = callback(table[3]);
2026-07-29 08:29:29 +00:00
obj = { limit: null };
obj[0] = table;
const gameAnnouncements = obj.getGameAnnouncements(tmp, obj);
2026-07-20 16:05:17 +00:00
}
}, items1);
let messages;
2026-07-29 08:29:29 +00:00
if (data != null) {
2026-07-20 16:05:17 +00:00
messages = data.messages;
}
2026-07-29 08:29:29 +00:00
if (messages == null) {
2026-07-20 16:05:17 +00:00
messages = [];
}
2026-07-29 08:29:29 +00:00
obj = { messages, channelId: null, guildId: null, loading: null };
2026-07-20 16:05:17 +00:00
let channelId;
2026-07-29 08:29:29 +00:00
if (data != null) {
2026-07-20 16:05:17 +00:00
channelId = data.channelId;
}
2026-07-29 08:29:29 +00:00
obj[1] = channelId;
2026-07-20 16:05:17 +00:00
let guildId;
2026-07-29 08:29:29 +00:00
if (data != null) {
2026-07-20 16:05:17 +00:00
guildId = data.guildId;
}
2026-07-29 08:29:29 +00:00
obj[2] = guildId;
obj[3] = stateFromStoresObject.isFetching;
2026-07-20 16:05:17 +00:00
return obj;
};