diff options
author | Commandtechno <68407783+Commandtechno@users.noreply.github.com> | 2023-06-27 15:41:52 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-27 22:41:52 +0200 |
commit | 12e3c9234de78af0ad05ef0272469911101f3c3a (patch) | |
tree | 1652bc84bbcd9bcc72ba1b19a59f9e2b05ac5f47 | |
parent | 1d8dcef394726a22abcb075a85c8cbaf75091761 (diff) | |
download | Vencord-12e3c9234de78af0ad05ef0272469911101f3c3a.tar.gz Vencord-12e3c9234de78af0ad05ef0272469911101f3c3a.tar.bz2 Vencord-12e3c9234de78af0ad05ef0272469911101f3c3a.zip |
ViewIcons: Fix animated server pfps & profile edit button (#1350)
fixes #1236
-rw-r--r-- | src/plugins/viewIcons.tsx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/plugins/viewIcons.tsx b/src/plugins/viewIcons.tsx index 616d178..3bfe902 100644 --- a/src/plugins/viewIcons.tsx +++ b/src/plugins/viewIcons.tsx @@ -35,7 +35,7 @@ interface UserContextProps { } interface GuildContextProps { - guild: Guild; + guild?: Guild; } const settings = definePluginSettings({ @@ -100,7 +100,8 @@ const UserContext: NavContextMenuPatchCallback = (children, { user, guildId }: U action={() => openImage(BannerStore.getGuildMemberAvatarURLSimple({ userId: user.id, avatar: memberAvatar, - guildId + guildId, + canAnimate: true }, true))} icon={ImageIcon} /> @@ -109,7 +110,10 @@ const UserContext: NavContextMenuPatchCallback = (children, { user, guildId }: U )); }; -const GuildContext: NavContextMenuPatchCallback = (children, { guild: { id, icon, banner } }: GuildContextProps) => () => { +const GuildContext: NavContextMenuPatchCallback = (children, { guild }: GuildContextProps) => () => { + if(!guild) return; + + const { id, icon, banner } = guild; if (!banner && !icon) return; children.splice(-1, 0, ( @@ -181,8 +185,8 @@ export default definePlugin({ // style: { backgroundImage: shouldShowBanner ? "url(".concat(bannerUrl, match: /style:\{(?=backgroundImage:(\i&&\i)\?"url\("\.concat\((\i),)/, replace: - // onClick: () => shouldShowBanner && openImage(bannerUrl), style: { cursor: shouldShowBanner ? "pointer" : void 0, - 'onClick:()=>$1&&$self.openImage($2),style:{cursor:$1?"pointer":void 0,' + // onClick: () => shouldShowBanner && ev.target.style.backgroundImage && openImage(bannerUrl), style: { cursor: shouldShowBanner ? "pointer" : void 0, + 'onClick:ev=>$1&&ev.target.style.backgroundImage&&$self.openImage($2),style:{cursor:$1?"pointer":void 0,' } }, { |