From 64180362fda076519c310f74e9245c94543edd39 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Sat, 21 Jan 2023 10:37:36 -0300 Subject: ViewIcons: Fix finding ImageModal and props passing to MaskedLink (#442) * Fix finding ImageModal and props passing to MaskedLink * gonna stick this here --- src/plugins/ignoreActivities.tsx | 4 ++-- src/plugins/viewIcons.tsx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/ignoreActivities.tsx b/src/plugins/ignoreActivities.tsx index 3b1ee98..300caf7 100644 --- a/src/plugins/ignoreActivities.tsx +++ b/src/plugins/ignoreActivities.tsx @@ -158,7 +158,7 @@ export default definePlugin({ find: '.displayName="LocalActivityStore"', replacement: { match: /(?.)\.push\(.\({type:.\..{1,3}\.LISTENING.+?\)\)/, - replace: "$&;$=$.filter(Vencord.Plugins.plugins.IgnoreActivities.isActivityIgnored);" + replace: "$&;$=$.filter(Vencord.Plugins.plugins.IgnoreActivities.isActivityNotIgnored);" } }], @@ -205,7 +205,7 @@ export default definePlugin({ ); }, - isActivityIgnored(props: { type: number; application_id?: string; name?: string; }) { + isActivityNotIgnored(props: { type: number; application_id?: string; name?: string; }) { if (props.type === 0) { if (props.application_id !== undefined) return !ignoredActivitiesCache.has(props.application_id); else { diff --git a/src/plugins/viewIcons.tsx b/src/plugins/viewIcons.tsx index 63f3554..307fd01 100644 --- a/src/plugins/viewIcons.tsx +++ b/src/plugins/viewIcons.tsx @@ -20,11 +20,11 @@ import { Devs } from "@utils/constants"; import { LazyComponent } from "@utils/misc"; import { ModalRoot, ModalSize, openModal } from "@utils/modal"; import { PluginDef } from "@utils/types"; -import { find, findByPropsLazy } from "@webpack"; +import { find, findByCode, findByPropsLazy } from "@webpack"; import { Menu } from "@webpack/common"; import type { Guild } from "discord-types/general"; -const ImageModal = LazyComponent(() => find(m => m.prototype?.render?.toString().includes("this.renderMobileCloseButton()"))); +const ImageModal = LazyComponent(() => findByCode(".MEDIA_MODAL_CLOSE,")); const MaskedLink = LazyComponent(() => find(m => m.type?.toString().includes("MASKED_LINK)"))); const GuildBannerStore = findByPropsLazy("getGuildBannerURL"); @@ -48,7 +48,7 @@ export default new class ViewIcons implements PluginDef { shouldAnimate={true} original={url} src={url} - renderLinkComponent={() => } + renderLinkComponent={MaskedLink} /> )); -- cgit