[skip ci] Fix InvisibleChat button being added to wrong chat box (#1100)

This commit is contained in:
Nuckyz 2023-05-11 14:44:33 -03:00 committed by GitHub
parent 393f76749a
commit 0c54b1fa1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,7 +64,13 @@ function Indicator() {
}
function ChatBarIcon() {
function ChatBarIcon(chatBoxProps: {
type: {
analyticsName: string;
};
}) {
if (chatBoxProps.type.analyticsName !== "normal") return null;
return (
<Tooltip text="Encrypt Message">
{({ 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{}",
}
},
],