From 64fa2f8652c9ae926c2510c050ca27099154485c Mon Sep 17 00:00:00 2001 From: Vendicated Date: Tue, 6 Feb 2024 17:06:26 +0100 Subject: [PATCH] ChatButtonApi: do not add buttons if you can't send messages --- src/api/ChatButtons.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/api/ChatButtons.tsx b/src/api/ChatButtons.tsx index 3cef250b3..84cca227f 100644 --- a/src/api/ChatButtons.tsx +++ b/src/api/ChatButtons.tsx @@ -80,6 +80,8 @@ const buttonFactories = new Map(); const logger = new Logger("ChatButtons"); export function _injectButtons(buttons: ReactNode[], props: ChatBarProps) { + if (props.disabled) return; + for (const [key, makeButton] of buttonFactories) { try { const res = makeButton(props, props.type.analyticsName === "normal");