fix ValidUser (#2369)

main
Elvyra 7 months ago committed by GitHub
parent 97ce410f57
commit 5aa19bbf49
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -111,7 +111,7 @@ function MentionWrapper({ data, UserMention, RoleMention, parse, props }: Mentio
export default definePlugin({ export default definePlugin({
name: "ValidUser", name: "ValidUser",
description: "Fix mentions for unknown users showing up as '<@343383572805058560>' (hover over a mention to fix it)", description: "Fix mentions for unknown users showing up as '@unknown-user' (hover over a mention to fix it)",
authors: [Devs.Ven], authors: [Devs.Ven],
tags: ["MentionCacheFix"], tags: ["MentionCacheFix"],
@ -119,7 +119,7 @@ export default definePlugin({
find: 'className:"mention"', find: 'className:"mention"',
replacement: { replacement: {
// mention = { react: function (data, parse, props) { if (data.userId == null) return RoleMention() else return UserMention() // mention = { react: function (data, parse, props) { if (data.userId == null) return RoleMention() else return UserMention()
match: /react(?=\(\i,\i,\i\).{0,50}return null==\i\?\(0,\i\.jsx\)\((\i\.\i),.+?jsx\)\((\i\.\i),\{className:"mention")/, match: /react(?=\(\i,\i,\i\).{0,50}return null==.{0,70}\?\(0,\i\.jsx\)\((\i\.\i),.+?jsx\)\((\i\.\i),\{className:"mention")/,
// react: (...args) => OurWrapper(RoleMention, UserMention, ...args), originalReact: theirFunc // react: (...args) => OurWrapper(RoleMention, UserMention, ...args), originalReact: theirFunc
replace: "react:(...args)=>$self.renderMention($1,$2,...args),originalReact" replace: "react:(...args)=>$self.renderMention($1,$2,...args),originalReact"
} }

Loading…
Cancel
Save