ChatButtonApi: do not add buttons if you can't send messages

This commit is contained in:
Vendicated 2024-02-06 17:06:26 +01:00
parent e58aa5dbab
commit 64fa2f8652
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18

View file

@ -80,6 +80,8 @@ const buttonFactories = new Map<string, ChatBarButton>();
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");