26 lines
1.0 KiB
TypeScript
26 lines
1.0 KiB
TypeScript
// Metro module 9960 (f9961).
|
|
import MessageReactionsStore from "../../stores/MessageReactionsStore";
|
|
import { DEFAULT_NUM_REACTION_USERS } from "../../Constants";
|
|
import { useStateFromStores } from "../../_bundle/Module589";
|
|
import { ReactionTypes } from "../messages/MessageReactionsTypes";
|
|
import isUndefinedOrNull from "../../_bundle/isUndefinedOrNull";
|
|
export default function useVoteReactors({ channelId, messageId, reaction }) {
|
|
const stateFromStores = useStateFromStores([MessageReactionsStore], () => {
|
|
const reactions = MessageReactionsStore.getReactions(channelId, messageId, reaction.emoji, DEFAULT_NUM_REACTION_USERS, ReactionTypes.VOTE);
|
|
const r5 = Array;
|
|
let r25 = reactions == null ? void 0 : reactions.values();
|
|
if (r25 == null) {
|
|
r25 = [];
|
|
}
|
|
return r5.from(r25);
|
|
}, [channelId, messageId, reaction.emoji], isUndefinedOrNull);
|
|
let r29 = reaction.count_details?.vote;
|
|
if (r29 == null) {
|
|
r29 = 0;
|
|
}
|
|
return {
|
|
reactors: stateFromStores,
|
|
hasMore: r29 > stateFromStores.length
|
|
};
|
|
};
|