72 lines
2 KiB
TypeScript
72 lines
2 KiB
TypeScript
// Module ID: 8655
|
|
// Function ID: 8656
|
|
// Name: useGameAnnouncements
|
|
// Dependencies: [19, 8482, 589, 8656, 2]
|
|
// Exports: default
|
|
|
|
// Module 8655 (useGameAnnouncements)
|
|
import { useEffect } from "noop";
|
|
import getSimilarGames from "getSimilarGames";
|
|
|
|
let result = require("initialize").fileFinishedImporting("modules/game_profile/hooks/useGameAnnouncements.tsx");
|
|
|
|
export default function useGameAnnouncements(arg0, arg1) {
|
|
let data;
|
|
let hasFetched;
|
|
const _require = arg0;
|
|
const dependencyMap = arg1;
|
|
let obj = _require(589);
|
|
const items = [getSimilarGames];
|
|
const stateFromStoresObject = obj.useStateFromStoresObject(items, () => {
|
|
let announcements;
|
|
if (null != closure_0) {
|
|
announcements = outer1_3.getAnnouncements(tmp);
|
|
}
|
|
const obj = { data: announcements, hasFetched: null, isFetching: null };
|
|
let result = null != tmp;
|
|
if (result) {
|
|
result = outer1_3.hasAnnouncementsBeenFetched(tmp);
|
|
}
|
|
obj[1] = result;
|
|
let result1 = null != tmp;
|
|
if (result1) {
|
|
result1 = outer1_3.isAnnouncementsFetching(tmp);
|
|
}
|
|
obj[2] = result1;
|
|
return obj;
|
|
});
|
|
({ data, hasFetched } = stateFromStoresObject);
|
|
const items1 = [arg0, hasFetched, arg1];
|
|
hasFetched(() => {
|
|
let result = null == callback || hasFetched;
|
|
if (!result) {
|
|
result = outer1_3.isAnnouncementsFetching(tmp);
|
|
}
|
|
if (!result) {
|
|
let obj = callback(table[3]);
|
|
obj = { limit: null };
|
|
obj[0] = table;
|
|
const gameAnnouncements = obj.getGameAnnouncements(tmp, obj);
|
|
}
|
|
}, items1);
|
|
let messages;
|
|
if (data != null) {
|
|
messages = data.messages;
|
|
}
|
|
if (messages == null) {
|
|
messages = [];
|
|
}
|
|
obj = { messages, channelId: null, guildId: null, loading: null };
|
|
let channelId;
|
|
if (data != null) {
|
|
channelId = data.channelId;
|
|
}
|
|
obj[1] = channelId;
|
|
let guildId;
|
|
if (data != null) {
|
|
guildId = data.guildId;
|
|
}
|
|
obj[2] = guildId;
|
|
obj[3] = stateFromStoresObject.isFetching;
|
|
return obj;
|
|
};
|