ValidUser: fix rendering old mentions when message is edited

Fixes https://github.com/Vendicated/Vencord/issues/2451
This commit is contained in:
Vendicated 2024-05-13 03:34:01 +02:00
parent 1f1c80c5f3
commit f6765818d2
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18
2 changed files with 3 additions and 2 deletions

View file

@ -83,7 +83,7 @@ export default definePlugin({
// Rendering
{
match: /"renderRow",(\i)=>{(?<="renderDM",.+?(\i\.default),\{channel:.+?)/,
replace: "$&if($self.isChannelIndex($1.section, $1.row))return $self.renderChannel($1.section,$1.row,$2);"
replace: "$&if($self.isChannelIndex($1.section, $1.row))return $self.renderChannel($1.section,$1.row,$2)();"
},
{
match: /"renderSection",(\i)=>{/,

View file

@ -23,7 +23,7 @@ import { sleep } from "@utils/misc";
import { Queue } from "@utils/Queue";
import definePlugin from "@utils/types";
import { Constants, FluxDispatcher, RestAPI, UserProfileStore, UserStore, useState } from "@webpack/common";
import type { ComponentType, ReactNode } from "react";
import { type ComponentType, type ReactNode } from "react";
// LYING to the type checker here
const UserFlags = Constants.UserFlags as Record<string, number>;
@ -205,6 +205,7 @@ export default definePlugin({
return (
<ErrorBoundary noop>
<MentionWrapper
key={"mention" + data.userId}
RoleMention={RoleMention}
UserMention={UserMention}
data={data}