fix whoreacted, betteruploadbutton (#1877)
This commit is contained in:
parent
bb900785ed
commit
f385dc380e
|
@ -29,9 +29,8 @@ export default definePlugin({
|
||||||
replacement: {
|
replacement: {
|
||||||
// Discord merges multiple props here with Object.assign()
|
// Discord merges multiple props here with Object.assign()
|
||||||
// This patch passes a third object to it with which we override onClick and onContextMenu
|
// This patch passes a third object to it with which we override onClick and onContextMenu
|
||||||
match: /CHAT_ATTACH_UPLOAD_OR_INVITE,onDoubleClick:(.+?:void 0)\},(.{1,3})\)/,
|
match: /CHAT_ATTACH_UPLOAD_OR_INVITE,onDoubleClick:(.+?:void 0),\.\.\.(\i),/,
|
||||||
replace: (m, onDblClick, otherProps) =>
|
replace: "$&onClick:$1,onContextMenu:$2.onClick,",
|
||||||
`${m.slice(0, -1)},{onClick:${onDblClick},onContextMenu:${otherProps}.onClick})`,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
@ -96,8 +96,8 @@ export default definePlugin({
|
||||||
patches: [{
|
patches: [{
|
||||||
find: ",reactionRef:",
|
find: ",reactionRef:",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /(?<=(\i)=(\i)\.hideCount,)(.+?reactionCount.+?\}\))/,
|
match: /(\i)\?null:\(0,\i\.jsx\)\(\i\.\i,{className:\i\.reactionCount,.*?}\),/,
|
||||||
replace: (_, hideCount, props, rest) => `whoReactedProps=${props},${rest},${hideCount}?null:$self.renderUsers(whoReactedProps)`
|
replace: "$&$1?null:$self.renderUsers(this.props),"
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
find: '.displayName="MessageReactionsStore";',
|
find: '.displayName="MessageReactionsStore";',
|
||||||
|
|
Loading…
Reference in a new issue