From 0c54b1fa1d8f9d858baf912bb4b1efd9d3c0ec93 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Thu, 11 May 2023 14:44:33 -0300 Subject: [PATCH] [skip ci] Fix InvisibleChat button being added to wrong chat box (#1100) --- src/plugins/invisibleChat/index.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/invisibleChat/index.tsx b/src/plugins/invisibleChat/index.tsx index feae548f..fb173ee8 100644 --- a/src/plugins/invisibleChat/index.tsx +++ b/src/plugins/invisibleChat/index.tsx @@ -64,7 +64,13 @@ function Indicator() { } -function ChatBarIcon() { +function ChatBarIcon(chatBoxProps: { + type: { + analyticsName: string; + }; +}) { + if (chatBoxProps.type.analyticsName !== "normal") return null; + return ( {({ onMouseEnter, onMouseLeave }) => ( @@ -133,7 +139,7 @@ export default definePlugin({ find: ".activeCommandOption", replacement: { match: /(.)\.push.{1,30}disabled:(\i),.{1,20}\},"gift"\)\)/, - replace: "$&;try{$2||$1.push($self.chatBarIcon())}catch{}", + replace: "$&;try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}", } }, ],