fix message hover buttons... again
This commit is contained in:
parent
d1996034b7
commit
021d9bf179
|
@ -50,18 +50,18 @@ export function removeButton(identifier: string) {
|
||||||
|
|
||||||
export function _buildPopoverElements(
|
export function _buildPopoverElements(
|
||||||
Component: React.ComponentType<ButtonItem>,
|
Component: React.ComponentType<ButtonItem>,
|
||||||
props: { message: Message; }
|
message: Message
|
||||||
) {
|
) {
|
||||||
const items: React.ReactNode[] = [];
|
const items: React.ReactNode[] = [];
|
||||||
|
|
||||||
for (const [identifier, getItem] of buttons.entries()) {
|
for (const [identifier, getItem] of buttons.entries()) {
|
||||||
try {
|
try {
|
||||||
const item = getItem(props.message);
|
const item = getItem(message);
|
||||||
if (item) {
|
if (item) {
|
||||||
item.key ??= identifier;
|
item.key ??= identifier;
|
||||||
items.push(
|
items.push(
|
||||||
<ErrorBoundary noop>
|
<ErrorBoundary noop>
|
||||||
<Component {...item} {...props} />
|
<Component {...item} />
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ export default definePlugin({
|
||||||
find: "Messages.MESSAGE_UTILITIES_A11Y_LABEL",
|
find: "Messages.MESSAGE_UTILITIES_A11Y_LABEL",
|
||||||
replacement: {
|
replacement: {
|
||||||
// foo && !bar ? createElement(reactionStuffs)... createElement(blah,...makeElement(reply-other))
|
// foo && !bar ? createElement(reactionStuffs)... createElement(blah,...makeElement(reply-other))
|
||||||
match: /\i&&!\i\?\(0,\i\.jsxs?\)\(.{0,200}renderEmojiPicker:.{0,500}\?\(0,\i\.jsx\)\((\i\.\i).{0,200}\.\.\.(\i)\},"reply-other"/,
|
match: /\i&&!\i\?\(0,\i\.jsxs?\)\(.{0,200}renderEmojiPicker:.{0,500}\?\(0,\i\.jsx\)\((\i\.\i).{0,200},"reply-other"(?<=message:(\i).+?)/,
|
||||||
replace: "Vencord.Api.MessagePopover._buildPopoverElements($1,$2),$&"
|
replace: "Vencord.Api.MessagePopover._buildPopoverElements($1,$2),$&"
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
|
|
Loading…
Reference in a new issue