decord/source/modules/polls/useVoteReactors.tsx

44 lines
1.3 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 10925
// Function ID: 10926
2026-07-20 16:05:17 +00:00
// Name: useVoteReactors
2026-08-24 06:08:38 +00:00
// Dependencies: [7547, 676, 589, 7548, 659, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 10925 (useVoteReactors)
import closure_3 from "reactionKey" /* 7547 */;
import { DEFAULT_NUM_REACTION_USERS as closure_4 } from "ME" /* 676 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
const result = require("set").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-08-24 06:08:38 +00:00
let items = [closure_3];
2026-07-20 16:05:17 +00:00
const items1 = [channelId, messageId, reaction.emoji];
const stateFromStores = obj.useStateFromStores(items, () => {
2026-08-24 06:08:38 +00:00
const reactions = closure_1_3.getReactions(channelId, messageId, reaction.emoji, closure_1_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;
};