1
0
Fork 1
mirror of https://github.com/Vendicated/Vencord.git synced 2025-01-10 18:06:22 +00:00

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 committed by Luna
parent d03b7f49cc
commit 7e3a73db06

View file

@ -80,6 +80,8 @@ const buttonFactories = new Map<string, ChatBarButton>();
const logger = new Logger("ChatButtons"); const logger = new Logger("ChatButtons");
export function _injectButtons(buttons: ReactNode[], props: ChatBarProps) { export function _injectButtons(buttons: ReactNode[], props: ChatBarProps) {
if (props.disabled) return;
for (const [key, makeButton] of buttonFactories) { for (const [key, makeButton] of buttonFactories) {
try { try {
const res = makeButton(props, props.type.analyticsName === "normal"); const res = makeButton(props, props.type.analyticsName === "normal");