This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,34 @@
// Metro module 8655 (f8656).
import { useEffect } from "react";
import GameProfileStore from "../GameProfileStore";
import { useStateFromStoresObject } from "../../../_bundle/Module589";
import { getGameAnnouncements } from "../GameProfileHttpUtils";
export default function useGameAnnouncements(a0, a1) {
let hasFetched;
const limit = a1;
const stateFromStoresObject = useStateFromStoresObject([GameProfileStore], () => ({
data: a0 != null ? GameProfileStore.getAnnouncements(a0) : void 0,
hasFetched: a0 != null && GameProfileStore.hasAnnouncementsBeenFetched(a0),
isFetching: a0 != null && GameProfileStore.isAnnouncementsFetching(a0)
}));
const data = stateFromStoresObject.data;
hasFetched = stateFromStoresObject.hasFetched;
const isFetching = stateFromStoresObject.isFetching;
useEffect(() => {
if (!(a0 == null || hasFetched || GameProfileStore.isAnnouncementsFetching(a0))) {
getGameAnnouncements(a0, {
limit
});
}
}, [a0, hasFetched, a1]);
let messages = data?.messages;
if (messages == null) {
messages = [];
}
return {
messages,
channelId: data?.channelId,
guildId: data?.guildId,
loading: isFetching
};
};