From c183018fb1b3ef04c7d103c2dd39f1fa89993c87 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Sat, 3 Aug 2024 15:28:18 -0300 Subject: [PATCH] fix logged in dependant find --- scripts/build/common.mjs | 2 +- src/components/PluginSettings/PluginModal.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/build/common.mjs b/scripts/build/common.mjs index c46a559a7..62a36ff27 100644 --- a/scripts/build/common.mjs +++ b/scripts/build/common.mjs @@ -299,7 +299,7 @@ export const commonOpts = { logLevel: "info", bundle: true, watch, - minify: !watch, + minify: !watch && !IS_REPORTER, sourcemap: watch ? "inline" : "", legalComments: "linked", banner, diff --git a/src/components/PluginSettings/PluginModal.tsx b/src/components/PluginSettings/PluginModal.tsx index 364d0a48c..a340dbc16 100644 --- a/src/components/PluginSettings/PluginModal.tsx +++ b/src/components/PluginSettings/PluginModal.tsx @@ -28,8 +28,8 @@ import { Margins } from "@utils/margins"; import { classes, isObjectEmpty } from "@utils/misc"; import { ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal"; import { OptionType, Plugin } from "@utils/types"; -import { findByProps, findComponentByCode, webpackDependantLazy } from "@webpack"; -import { Button, Clickable, FluxDispatcher, Forms, React, Text, Tooltip, UserStore, UserUtils } from "@webpack/common"; +import { find, findByProps, findComponentByCode } from "@webpack"; +import { Button, Clickable, FluxDispatcher, Forms, React, Text, Tooltip, UserUtils } from "@webpack/common"; import { User } from "discord-types/general"; import { Constructor } from "type-fest"; @@ -51,7 +51,7 @@ const cl = classNameFactory("vc-plugin-modal-"); const UserSummaryItem = findComponentByCode("defaultRenderUser", "showDefaultAvatarsForNullUsers"); const AvatarStyles = findByProps("moreUsers", "emptyUser", "avatarContainer", "clickableAvatar"); -const UserRecord = webpackDependantLazy>>(() => UserStore.getCurrentUser().constructor as any); +const UserRecord = find>>(m => m?.prototype?.getAvatarURL && m?.prototype?.hasHadPremium); interface PluginModalProps extends ModalProps { plugin: Plugin;