From 74b6ceee7838d7190f43336c9c29acd392f1870f Mon Sep 17 00:00:00 2001 From: Vendicated Date: Thu, 28 Mar 2024 03:43:37 +0100 Subject: [PATCH] Fix WhoReacted --- src/plugins/whoReacted/index.tsx | 40 +++++++++++++++++--------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/src/plugins/whoReacted/index.tsx b/src/plugins/whoReacted/index.tsx index b60366900..b3728c215 100644 --- a/src/plugins/whoReacted/index.tsx +++ b/src/plugins/whoReacted/index.tsx @@ -93,28 +93,30 @@ export default definePlugin({ description: "Renders the avatars of users who reacted to a message", authors: [Devs.Ven, Devs.KannaDev, Devs.newwares], - patches: [{ - find: ",reactionRef:", - replacement: { - match: /(\i)\?null:\(0,\i\.jsx\)\(\i\.\i,{className:\i\.reactionCount,.*?}\),/, - replace: "$&$1?null:$self.renderUsers(this.props)," - } - }, { - find: '.displayName="MessageReactionsStore";', - replacement: { - match: /(?<=CONNECTION_OPEN:function\(\){)(\i)={}/, - replace: "$&;$self.reactions=$1" - } - }, - { + patches: [ + { + find: ",reactionRef:", + replacement: { + match: /(\i)\?null:\(0,\i\.jsx\)\(\i\.\i,{className:\i\.reactionCount,.*?}\),/, + replace: "$&$1?null:$self.renderUsers(this.props)," + } + }, { + find: '"MessageReactionsStore"', + replacement: { + match: /(?<=CONNECTION_OPEN:function\(\){)(\i)={}/, + replace: "$&;$self.reactions=$1" + } + }, + { - find: "cleanAutomaticAnchor(){", - replacement: { - match: /this\.automaticAnchor=null,this\.messageFetchAnchor=null,/, - replace: "$&$self.setScrollObj(this)," + find: "cleanAutomaticAnchor(){", + replacement: { + match: /constructor\(\i\)\{(?=.{0,100}automaticAnchor)/, + replace: "$&$self.setScrollObj(this);" + } } - } ], + setScrollObj(scroll: any) { Scroll = scroll; },