mirror of
https://github.com/System-End/Vencord.git
synced 2026-04-19 20:55:13 +00:00
fix chat bar buttons not showing
This commit is contained in:
parent
ed1baadac3
commit
e90b31e717
2 changed files with 5 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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])"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue