decord/source/modules/polls/useVoteReactors.tsx

44 lines
1.3 KiB
TypeScript
Raw Normal View History

2026-07-30 10:14:41 +00:00
// Module ID: 9956
// Function ID: 9957
2026-07-20 16:05:17 +00:00
// Name: useVoteReactors
2026-07-30 10:14:41 +00:00
// Dependencies: [6071, 676, 589, 6072, 659, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-30 10:14:41 +00:00
// Module 9956 (useVoteReactors)
2026-07-29 08:29:29 +00:00
import reactionKey from "reactionKey";
2026-07-23 10:11:24 +00:00
import { DEFAULT_NUM_REACTION_USERS as closure_4 } from "ME";
const require = arg1;
const result = require("initialize").fileFinishedImporting("modules/polls/useVoteReactors.tsx");
2026-07-20 16:05:17 +00:00
export default function useVoteReactors(channelId) {
channelId = channelId.channelId;
const messageId = channelId.messageId;
const reaction = channelId.reaction;
2026-07-23 10:11:24 +00:00
let obj = channelId(reaction[2]);
2026-07-29 08:29:29 +00:00
let items = [reactionKey];
2026-07-20 16:05:17 +00:00
const items1 = [channelId, messageId, reaction.emoji];
const stateFromStores = obj.useStateFromStores(items, () => {
2026-07-23 10:11:24 +00:00
const reactions = outer1_3.getReactions(channelId, messageId, reaction.emoji, outer1_4, channelId(reaction[3]).ReactionTypes.VOTE);
2026-07-29 08:29:29 +00:00
let items;
if (reactions != null) {
2026-07-20 16:05:17 +00:00
items = reactions.values();
}
2026-07-29 08:29:29 +00:00
if (items == null) {
2026-07-20 16:05:17 +00:00
items = [];
}
return Array.from(items);
2026-07-23 10:11:24 +00:00
}, items1, messageId(reaction[4]));
2026-07-29 08:29:29 +00:00
obj = { reactors: stateFromStores, hasMore: null };
2026-07-20 16:05:17 +00:00
const count_details = reaction.count_details;
2026-07-29 08:29:29 +00:00
let num;
if (count_details != null) {
num = count_details.vote;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (num == null) {
num = 0;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[1] = num > stateFromStores.length;
2026-07-20 16:05:17 +00:00
return obj;
};