mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-07 13:43:03 -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"',
|
find: '"MessageManager"',
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /(?<=\(\i\)\)return;)(?=.+?getChannel\((\i)\))/,
|
match: /forceFetch:\i,isPreload:.+?}=\i;(?=.+?getChannel\((\i)\))/,
|
||||||
replace: (m, channelId) => `${m}if($self.isHiddenChannel({channelId:${channelId}}))return;`
|
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) {
|
function getReactionsWithQueue(msg: Message, e: ReactionEmoji, type: number) {
|
||||||
const key = `${msg.id}:${e.name}:${e.id ?? ""}:${type}`;
|
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) {
|
if (!cache.fetched) {
|
||||||
queue.unshift(() => fetchReactions(msg, e, type));
|
queue.unshift(() => fetchReactions(msg, e, type));
|
||||||
cache.fetched = true;
|
cache.fetched = true;
|
||||||
|
@ -169,7 +169,7 @@ export default definePlugin({
|
||||||
}, [message.id, forceUpdate]);
|
}, [message.id, forceUpdate]);
|
||||||
|
|
||||||
const reactions = getReactionsWithQueue(message, emoji, type);
|
const reactions = getReactionsWithQueue(message, emoji, type);
|
||||||
const users = Object.values(reactions).filter(Boolean) as User[];
|
const users = [...reactions.values()].filter(Boolean);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
@ -201,7 +201,7 @@ export default definePlugin({
|
||||||
|
|
||||||
interface ReactionCacheEntry {
|
interface ReactionCacheEntry {
|
||||||
fetched: boolean;
|
fetched: boolean;
|
||||||
users: Record<string, User>;
|
users: Map<string, User>;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RootObject {
|
interface RootObject {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue