BetterUploadButton: don't affect other chat buttons
This commit is contained in:
parent
a02d1afdf0
commit
1ebd412392
2 changed files with 12 additions and 3 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "vencord",
|
||||
"private": "true",
|
||||
"version": "1.12.8",
|
||||
"version": "1.12.9",
|
||||
"description": "The cutest Discord client mod",
|
||||
"homepage": "https://github.com/Vendicated/Vencord#readme",
|
||||
"bugs": {
|
||||
|
|
|
|||
|
|
@ -28,10 +28,19 @@ export default definePlugin({
|
|||
find: ".CHAT_INPUT_BUTTON_NOTIFICATION,",
|
||||
replacement: [
|
||||
{
|
||||
match: /onClick:(\i\?void 0:\i)(?=,onDoubleClick:(\i\?void 0:\i))/,
|
||||
replace: "onContextMenu:$1,onClick:$2",
|
||||
match: /onClick:(\i\?void 0:\i)(?=,onDoubleClick:(\i\?void 0:\i),)/,
|
||||
replace: "$&,...$self.getOverrides(arguments[0],$1,$2)",
|
||||
},
|
||||
]
|
||||
},
|
||||
],
|
||||
|
||||
getOverrides(props: any, onClick: any, onDoubleClick: any) {
|
||||
if (!props?.className?.includes("attachButton")) return {};
|
||||
|
||||
return {
|
||||
onClick: onDoubleClick,
|
||||
onContextMenu: onClick
|
||||
};
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue