diff options
author | Vendicated <vendicated@riseup.net> | 2022-10-19 19:45:22 +0200 |
---|---|---|
committer | Vendicated <vendicated@riseup.net> | 2022-10-19 19:45:22 +0200 |
commit | d97c3e2e020e464635a929602f0815f566425206 (patch) | |
tree | ea39c07f5f7c101fad09cb1a8211add3ffc2cce9 /src/plugins | |
parent | 7cdc4e4c03e991d4203072e6a1127ce3e055b713 (diff) | |
download | Vencord-d97c3e2e020e464635a929602f0815f566425206.tar.gz Vencord-d97c3e2e020e464635a929602f0815f566425206.tar.bz2 Vencord-d97c3e2e020e464635a929602f0815f566425206.zip |
Fix ViewIcons, make banner have right cursor
Discord loves pushing 2 almost identical Avatar components for A/B
testing, they have never heard of an if statement :trolleybus:
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/viewIcons.tsx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/viewIcons.tsx b/src/plugins/viewIcons.tsx index d6cbf60..ca106ae 100644 --- a/src/plugins/viewIcons.tsx +++ b/src/plugins/viewIcons.tsx @@ -31,14 +31,15 @@ export default definePlugin({ { find: "onAddFriend:", replacement: { - match: /\{src:(.{1,2}),avatarDecoration/, + // global because Discord has two components that are 99% identical with one small change ._. + match: /\{src:(.{1,2}),avatarDecoration/g, replace: (_, src) => `{src:${src},onClick:()=>${OPEN_URL}${src}.replace(/\\?.+$/, "")+"?size=2048"),avatarDecoration` } }, { find: "().popoutNoBannerPremium", replacement: { match: /style:.{0,10}\{\},(.{1,2})\)/, - replace: (m, bannerObj) => `onClick:${bannerObj}.backgroundImage&&(()=>${OPEN_URL}${bannerObj}.backgroundImage.replace("url(", "").replace(/(\\?size=.+)?\\)/, "?size=2048"))),${m}` + replace: (m, style) => `onClick:${style}.backgroundImage&&(${style}.cursor="pointer",()=>${OPEN_URL}${style}.backgroundImage.replace("url(", "").replace(/(\\?size=.+)?\\)/, "?size=2048"))),${m}` } }, { find: '"GuildContextMenu:', |