BetterUploadButton: don't affect other chat buttons

This commit is contained in:
Vendicated 2025-08-03 17:04:50 +02:00
parent a02d1afdf0
commit 1ebd412392
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18
2 changed files with 12 additions and 3 deletions

View file

@ -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": {

View file

@ -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
};
}
});