aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-09-08 22:44:54 +0200
committerVendicated <vendicated@riseup.net>2022-09-08 22:44:54 +0200
commit5b2b91ed0d3ceac914c0dbb56905b87e12657c7a (patch)
tree3258ce08d3aa6a9f81f81684bc84883dc255313e
parent6099179f0230e3c6eb449a2cd7f6a5c5d79201f2 (diff)
downloadVencord-5b2b91ed0d3ceac914c0dbb56905b87e12657c7a.tar.gz
Vencord-5b2b91ed0d3ceac914c0dbb56905b87e12657c7a.tar.bz2
Vencord-5b2b91ed0d3ceac914c0dbb56905b87e12657c7a.zip
ViewIcons: Fix crash when developer mode is off
-rw-r--r--src/plugins/viewIcons.tsx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/viewIcons.tsx b/src/plugins/viewIcons.tsx
index 39c4303..218b4ed 100644
--- a/src/plugins/viewIcons.tsx
+++ b/src/plugins/viewIcons.tsx
@@ -47,11 +47,11 @@ export default definePlugin({
replace: (m, guild) => `_guild=${guild},${m}`
},
{
- match: /,(.{1,2})\((.{1,2}\.MenuGroup),\{\},void 0,(.{1,2})\)(?=\)\}.{1,2}\.displayName)/,
- replace: (_, factory, menuGroup, copyIdElement) => `,${factory}(${menuGroup},{},void 0,[` +
- `_guild.icon&&${REACT_GLOBAL}.cloneElement(${copyIdElement},` +
+ match: /,(.{1,2})\((.{1,2})\.MenuGroup,\{\},void 0,(.{1,2})\)(?=\)\}.{1,2}\.displayName)/,
+ replace: (_, factory, menu, copyIdElement) => `,${factory}(${menu}.MenuGroup,{},void 0,[` +
+ `_guild.icon&&${REACT_GLOBAL}.createElement(${menu}.MenuItem,` +
`{key:"viewicons-copy-icon",id:"viewicons-copy-icon",action:()=>${OPEN_URL}_guild.getIconURL(undefined,true)+"size=2048"),label:"View Icon",icon:null}),` +
- `_guild.banner&&${REACT_GLOBAL}.cloneElement(${copyIdElement},` +
+ `_guild.banner&&${REACT_GLOBAL}.createElement(${menu}.MenuItem,` +
`{key:"viewicons-copy-banner",id:"viewicons-copy-banner",action:()=>${OPEN_URL}Vencord.Webpack.findByProps("getGuildBannerURL").getGuildBannerURL(_guild).replace(/\\?size=.+/, "?size=2048")),label:"View Banner",icon:null}),${copyIdElement}])`
}
]