MessagePeek Fix

This commit is contained in:
thororen1234 2024-12-12 19:41:33 -05:00
parent 42663f131e
commit 2113eec7ac

View file

@ -41,10 +41,11 @@ export default definePlugin({
replacement: { replacement: {
match: /(?<=children:([^])[^]*)}\);/, match: /(?<=children:([^])[^]*)}\);/,
replace: `$& replace: `$&
if ($1[0] && $1[0].props && $1[0].props.children) {
$1[0].props.children[1].props.children=[ $1[0].props.children[1].props.children=[
$1[0].props.children[1].props.children, $1[0].props.children[1].props.children,
$self.renderMessagePeek({ channel: $1[0].props.children[0].props.channel }) $self.renderMessagePeek({ channel: $1[0].props.children[0].props.channel })
];`.replace(/\s+/g, "") ];};`.replace(/\s+/g, "")
}, },
predicate: () => settings.store.guildChannels === true predicate: () => settings.store.guildChannels === true
} }