aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/silentTyping.tsx
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2023-03-28 18:56:12 +0200
committerVendicated <vendicated@riseup.net>2023-03-28 18:56:12 +0200
commit081df6beb79a48ed970aaca7a5dde852651a6d61 (patch)
tree03259db7b06898d4eebad65c44b8cf0ad1e23acf /src/plugins/silentTyping.tsx
parentab911b48b5608d0a6781c325a123138815282f74 (diff)
downloadVencord-081df6beb79a48ed970aaca7a5dde852651a6d61.tar.gz
Vencord-081df6beb79a48ed970aaca7a5dde852651a6d61.tar.bz2
Vencord-081df6beb79a48ed970aaca7a5dde852651a6d61.zip
Fix SilentMessage/SilentTyping toggles showing in wrong sections
Closes #656
Diffstat (limited to 'src/plugins/silentTyping.tsx')
-rw-r--r--src/plugins/silentTyping.tsx10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/silentTyping.tsx b/src/plugins/silentTyping.tsx
index d0edaac..6d82840 100644
--- a/src/plugins/silentTyping.tsx
+++ b/src/plugins/silentTyping.tsx
@@ -37,10 +37,16 @@ const settings = definePluginSettings({
}
});
-function SilentTypingToggle() {
+function SilentTypingToggle(chatBoxProps: {
+ type: {
+ analyticsName: string;
+ };
+}) {
const { isEnabled } = settings.use(["isEnabled"]);
const toggle = () => settings.store.isEnabled = !settings.store.isEnabled;
+ if (chatBoxProps.type.analyticsName !== "normal") return null;
+
return (
<Tooltip text={isEnabled ? "Disable silent typing" : "Enable silent typing"}>
{(tooltipProps: any) => (
@@ -83,7 +89,7 @@ export default definePlugin({
predicate: () => settings.store.showIcon,
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{}",
}
},
],