From cc4266cbf229fc6613e3e4242f8bcc8870881f77 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Sat, 28 Dec 2024 21:22:29 -0500 Subject: [PATCH] Fix StatusPresets --- src/equicordplugins/statusPresets/index.tsx | 13 ++++++++++--- src/plugins/fakeNitro/index.tsx | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/equicordplugins/statusPresets/index.tsx b/src/equicordplugins/statusPresets/index.tsx index aac9b577..c0ab1fab 100644 --- a/src/equicordplugins/statusPresets/index.tsx +++ b/src/equicordplugins/statusPresets/index.tsx @@ -18,7 +18,7 @@ import "./style.css"; -import { definePluginSettings } from "@api/Settings"; +import { definePluginSettings, Settings } from "@api/Settings"; import { getUserSettingLazy } from "@api/UserSettings"; import ErrorBoundary from "@components/ErrorBoundary"; import { EquicordDevs } from "@utils/constants"; @@ -123,16 +123,23 @@ const RenderStatusMenuItem = ({ status, update, disabled }: { status: DiscordSta const StatusSubMenuComponent = () => { + let premiumType; + if (Settings.plugins.NoNitroUpsell.enabled) { + // @ts-ignore + premiumType = UserStore?.getCurrentUser()?._realPremiumType ?? UserStore?.getCurrentUser()?.premiumType ?? 0; + } else { + premiumType = UserStore?.getCurrentUser()?.premiumType ?? 0; + } const update = useForceUpdater(); return { }}> {Object.entries((settings.store.StatusPresets as { [k: string]: DiscordStatus | undefined; })).map(([index, status]) => status != null ? (status.emojiInfo?.id != null && UserStore.getCurrentUser().hasPremiumPerks || status.emojiInfo?.id == null) && setStatus(status)} + action={() => (status.emojiInfo?.id != null && premiumType > 0 || status.emojiInfo?.id == null) && setStatus(status)} render={() => } /> : null)} ; diff --git a/src/plugins/fakeNitro/index.tsx b/src/plugins/fakeNitro/index.tsx index 6e13ce5a..ffce2428 100644 --- a/src/plugins/fakeNitro/index.tsx +++ b/src/plugins/fakeNitro/index.tsx @@ -31,7 +31,7 @@ import { applyPalette, GIFEncoder, quantize } from "gifenc"; import type { ReactElement, ReactNode } from "react"; let premiumType; -if (Settings.plugins?.NoNitroUpsell?.enabled) { +if (Settings.plugins.NoNitroUpsell.enabled) { // @ts-ignore premiumType = UserStore?.getCurrentUser()?._realPremiumType ?? UserStore?.getCurrentUser()?.premiumType ?? 0; } else {