Merge branch 'dev' into immediate-finds
This commit is contained in:
commit
a3612dd4ee
|
@ -147,6 +147,7 @@ async function fetchMessage(channelID: string, messageID: string) {
|
||||||
if (!msg) return;
|
if (!msg) return;
|
||||||
|
|
||||||
const message: Message = MessageStore.getMessages(msg.channel_id).receiveMessage(msg).get(msg.id);
|
const message: Message = MessageStore.getMessages(msg.channel_id).receiveMessage(msg).get(msg.id);
|
||||||
|
if (!message) return;
|
||||||
|
|
||||||
messageCache.set(message.id, {
|
messageCache.set(message.id, {
|
||||||
message,
|
message,
|
||||||
|
|
|
@ -44,14 +44,23 @@ function fetchReactions(msg: Message, emoji: ReactionEmoji, type: number) {
|
||||||
},
|
},
|
||||||
oldFormErrors: true
|
oldFormErrors: true
|
||||||
})
|
})
|
||||||
.then(res => FluxDispatcher.dispatch({
|
.then(res => {
|
||||||
type: "MESSAGE_REACTION_ADD_USERS",
|
for (const user of res.body) {
|
||||||
channelId: msg.channel_id,
|
FluxDispatcher.dispatch({
|
||||||
messageId: msg.id,
|
type: "USER_UPDATE",
|
||||||
users: res.body,
|
user
|
||||||
emoji,
|
});
|
||||||
reactionType: type
|
}
|
||||||
}))
|
|
||||||
|
FluxDispatcher.dispatch({
|
||||||
|
type: "MESSAGE_REACTION_ADD_USERS",
|
||||||
|
channelId: msg.channel_id,
|
||||||
|
messageId: msg.id,
|
||||||
|
users: res.body,
|
||||||
|
emoji,
|
||||||
|
reactionType: type
|
||||||
|
});
|
||||||
|
})
|
||||||
.catch(console.error)
|
.catch(console.error)
|
||||||
.finally(() => sleep(250));
|
.finally(() => sleep(250));
|
||||||
}
|
}
|
||||||
|
@ -149,13 +158,6 @@ export default definePlugin({
|
||||||
const reactions = getReactionsWithQueue(message, emoji, type);
|
const reactions = getReactionsWithQueue(message, emoji, type);
|
||||||
const users = Object.values(reactions).filter(Boolean) as User[];
|
const users = Object.values(reactions).filter(Boolean) as User[];
|
||||||
|
|
||||||
for (const user of users) {
|
|
||||||
FluxDispatcher.dispatch({
|
|
||||||
type: "USER_UPDATE",
|
|
||||||
user
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
style={{ marginLeft: "0.5em", transform: "scale(0.9)" }}
|
style={{ marginLeft: "0.5em", transform: "scale(0.9)" }}
|
||||||
|
|
Loading…
Reference in a new issue