fix chat bar buttons not showing

This commit is contained in:
Vendicated 2025-11-12 22:05:20 +01:00
parent ed1baadac3
commit e90b31e717
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18
2 changed files with 5 additions and 3 deletions

View file

@ -84,12 +84,14 @@ export function _injectButtons(buttons: ReactNode[], props: ChatBarProps) {
if (props.disabled) return;
for (const [key, Button] of buttonFactories) {
buttons.push(
buttons.unshift(
<ErrorBoundary noop key={key} onError={e => logger.error(`Failed to render ${key}`, e.error)}>
<Button {...props} isMainChat={props.type.analyticsName === "normal"} />
</ErrorBoundary>
);
}
return buttons;
}
export const addChatBarButton = (id: string, button: ChatBarButtonFactory) => buttonFactories.set(id, button);

View file

@ -16,8 +16,8 @@ export default definePlugin({
{
find: '"sticker")',
replacement: {
match: /return\(\i\.\i\|\|(?=\(.+?(\i)\.push)/,
replace: "$&(Vencord.Api.ChatButtons._injectButtons($1,arguments[0]),false)||"
match: /(?<=className:.{0,20}\.buttons.{0,50}children:)(\i)/,
replace: "Vencord.Api.ChatButtons._injectButtons($1,arguments[0])"
}
}
]