aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/viewIcons.ts
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-09-02 23:02:08 +0200
committerVendicated <vendicated@riseup.net>2022-09-02 23:02:08 +0200
commit8a8c6a4b526ffcb37f42716d2896a6ff0f565d82 (patch)
treef383dff79e09bbbd0190eb163067b6a09eafadd9 /src/plugins/viewIcons.ts
parent3dd294e2adf586930f5650ac59f71ffc087f769b (diff)
downloadVencord-8a8c6a4b526ffcb37f42716d2896a6ff0f565d82.tar.gz
Vencord-8a8c6a4b526ffcb37f42716d2896a6ff0f565d82.tar.bz2
Vencord-8a8c6a4b526ffcb37f42716d2896a6ff0f565d82.zip
ViewIcons: Fix error when clicking nonexistant banner
Diffstat (limited to 'src/plugins/viewIcons.ts')
-rw-r--r--src/plugins/viewIcons.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/viewIcons.ts b/src/plugins/viewIcons.ts
index cb56265..a6ba4d4 100644
--- a/src/plugins/viewIcons.ts
+++ b/src/plugins/viewIcons.ts
@@ -6,7 +6,7 @@ const OPEN_URL = `VencordNative.ipc.invoke("${IpcEvents.OPEN_EXTERNAL}",`;
export default definePlugin({
name: "ViewIcons",
author: "Vendicated",
- description: "Makes Avatars/Banners in user profiles clickable, and adds Guild Context Menu Entries to View Banner/Icon",
+ description: "Makes Avatars/Banners in user profiles clickable, and adds Guild Context Menu Entries to View Banner/Icon. Crashes if you don't have Developer Mode enabled, will fix in the future.",
patches: [
{
find: "UserProfileModalHeader",
@@ -18,7 +18,7 @@ export default definePlugin({
find: "default.popoutNoBannerPremium",
replacement: {
match: /style:.{1,2}\(\{\},(.{1,2}),/,
- replace: (m, bannerObj) => `onClick:()=>${OPEN_URL}${bannerObj}.backgroundImage.replace("url(", "").replace(/(\\?size=.+)?\\)/, "?size=2048")),${m}`
+ replace: (m, bannerObj) => `onClick:${bannerObj}.backgroundImage&&(()=>${OPEN_URL}${bannerObj}.backgroundImage.replace("url(", "").replace(/(\\?size=.+)?\\)/, "?size=2048"))),${m}`
}
}, {
find: "GuildContextMenuWrapper",