Merge branch 'dev' into modules-proxy-patches

This commit is contained in:
Nuckyz 2024-07-17 17:03:12 -03:00
commit e57c99399d
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9
2 changed files with 18 additions and 15 deletions

View file

@ -147,6 +147,7 @@ async function fetchMessage(channelID: string, messageID: string) {
if (!msg) return;
const message: Message = MessageStore.getMessages(msg.channel_id).receiveMessage(msg).get(msg.id);
if (!message) return;
messageCache.set(message.id, {
message,

View file

@ -43,14 +43,23 @@ function fetchReactions(msg: Message, emoji: ReactionEmoji, type: number) {
},
oldFormErrors: true
})
.then(res => FluxDispatcher.dispatch({
type: "MESSAGE_REACTION_ADD_USERS",
channelId: msg.channel_id,
messageId: msg.id,
users: res.body,
emoji,
reactionType: type
}))
.then(res => {
for (const user of res.body) {
FluxDispatcher.dispatch({
type: "USER_UPDATE",
user
});
}
FluxDispatcher.dispatch({
type: "MESSAGE_REACTION_ADD_USERS",
channelId: msg.channel_id,
messageId: msg.id,
users: res.body,
emoji,
reactionType: type
});
})
.catch(console.error)
.finally(() => sleep(250));
}
@ -148,13 +157,6 @@ export default definePlugin({
const reactions = getReactionsWithQueue(message, emoji, type);
const users = Object.values(reactions).filter(Boolean) as User[];
for (const user of users) {
FluxDispatcher.dispatch({
type: "USER_UPDATE",
user
});
}
return (
<div
style={{ marginLeft: "0.5em", transform: "scale(0.9)" }}