mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-06 21:32:55 -04:00
Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
aa63557c11
2 changed files with 4 additions and 4 deletions
|
@ -299,7 +299,7 @@ export default definePlugin({
|
|||
{
|
||||
find: '"MessageManager"',
|
||||
replacement: {
|
||||
match: /(?<=\(\i\)\)return;)(?=.+?getChannel\((\i)\))/,
|
||||
match: /forceFetch:\i,isPreload:.+?}=\i;(?=.+?getChannel\((\i)\))/,
|
||||
replace: (m, channelId) => `${m}if($self.isHiddenChannel({channelId:${channelId}}))return;`
|
||||
}
|
||||
},
|
||||
|
|
|
@ -67,7 +67,7 @@ function fetchReactions(msg: Message, emoji: ReactionEmoji, type: number) {
|
|||
|
||||
function getReactionsWithQueue(msg: Message, e: ReactionEmoji, type: number) {
|
||||
const key = `${msg.id}:${e.name}:${e.id ?? ""}:${type}`;
|
||||
const cache = reactions[key] ??= { fetched: false, users: {} };
|
||||
const cache = reactions[key] ??= { fetched: false, users: new Map() };
|
||||
if (!cache.fetched) {
|
||||
queue.unshift(() => fetchReactions(msg, e, type));
|
||||
cache.fetched = true;
|
||||
|
@ -169,7 +169,7 @@ export default definePlugin({
|
|||
}, [message.id, forceUpdate]);
|
||||
|
||||
const reactions = getReactionsWithQueue(message, emoji, type);
|
||||
const users = Object.values(reactions).filter(Boolean) as User[];
|
||||
const users = [...reactions.values()].filter(Boolean);
|
||||
|
||||
return (
|
||||
<div
|
||||
|
@ -201,7 +201,7 @@ export default definePlugin({
|
|||
|
||||
interface ReactionCacheEntry {
|
||||
fetched: boolean;
|
||||
users: Record<string, User>;
|
||||
users: Map<string, User>;
|
||||
}
|
||||
|
||||
interface RootObject {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue