Merge remote-tracking branch 'upstream/dev' into dev
Some checks are pending
Release / Build Equicord (push) Waiting to run
Test / Test (push) Waiting to run

This commit is contained in:
thororen1234 2025-05-29 18:12:03 -04:00
commit aa63557c11
No known key found for this signature in database
2 changed files with 4 additions and 4 deletions

View file

@ -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;`
}
},

View file

@ -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 {