From f385dc380eb67db7b12cb5590c36b79ebe4a2809 Mon Sep 17 00:00:00 2001 From: rini Date: Wed, 25 Oct 2023 14:09:37 -0300 Subject: [PATCH] fix whoreacted, betteruploadbutton (#1877) --- src/plugins/betterUploadButton/index.ts | 5 ++--- src/plugins/whoReacted/index.tsx | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/plugins/betterUploadButton/index.ts b/src/plugins/betterUploadButton/index.ts index 64a37850..3eeb1e45 100644 --- a/src/plugins/betterUploadButton/index.ts +++ b/src/plugins/betterUploadButton/index.ts @@ -29,9 +29,8 @@ export default definePlugin({ replacement: { // Discord merges multiple props here with Object.assign() // This patch passes a third object to it with which we override onClick and onContextMenu - match: /CHAT_ATTACH_UPLOAD_OR_INVITE,onDoubleClick:(.+?:void 0)\},(.{1,3})\)/, - replace: (m, onDblClick, otherProps) => - `${m.slice(0, -1)},{onClick:${onDblClick},onContextMenu:${otherProps}.onClick})`, + match: /CHAT_ATTACH_UPLOAD_OR_INVITE,onDoubleClick:(.+?:void 0),\.\.\.(\i),/, + replace: "$&onClick:$1,onContextMenu:$2.onClick,", }, }, ], diff --git a/src/plugins/whoReacted/index.tsx b/src/plugins/whoReacted/index.tsx index a4e74f94..fb84c155 100644 --- a/src/plugins/whoReacted/index.tsx +++ b/src/plugins/whoReacted/index.tsx @@ -96,8 +96,8 @@ export default definePlugin({ patches: [{ find: ",reactionRef:", replacement: { - match: /(?<=(\i)=(\i)\.hideCount,)(.+?reactionCount.+?\}\))/, - replace: (_, hideCount, props, rest) => `whoReactedProps=${props},${rest},${hideCount}?null:$self.renderUsers(whoReactedProps)` + match: /(\i)\?null:\(0,\i\.jsx\)\(\i\.\i,{className:\i\.reactionCount,.*?}\),/, + replace: "$&$1?null:$self.renderUsers(this.props)," } }, { find: '.displayName="MessageReactionsStore";',