mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-17 02:17:03 -04:00
NoNitroUpsell Remove An Upsell
This commit is contained in:
parent
4693e0dbca
commit
c04ea1ff78
3 changed files with 13 additions and 21 deletions
|
@ -39,11 +39,13 @@ export default definePlugin({
|
||||||
authors: [EquicordDevs.thororen],
|
authors: [EquicordDevs.thororen],
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: "ProductCatalog",
|
find: "#{intl::USER_PROFILE_ENTRY_POINTS_AMP_UP_YOUR_PROFILE}",
|
||||||
replacement: {
|
replacement: [
|
||||||
match: /\i\.warn\("Cannot find the corresponding SKU to the user's premium type "\.concat\(\i\.premiumType\)\),/,
|
{
|
||||||
replace: ""
|
match: /}\);return \i\?.*?}\)}}/,
|
||||||
|
replace: "});return null}}"
|
||||||
}
|
}
|
||||||
|
],
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
start() {
|
start() {
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
import "./style.css";
|
import "./style.css";
|
||||||
|
|
||||||
import { definePluginSettings, Settings } from "@api/Settings";
|
import { definePluginSettings } from "@api/Settings";
|
||||||
import { getUserSettingLazy } from "@api/UserSettings";
|
import { getUserSettingLazy } from "@api/UserSettings";
|
||||||
import ErrorBoundary from "@components/ErrorBoundary";
|
import ErrorBoundary from "@components/ErrorBoundary";
|
||||||
import { EquicordDevs } from "@utils/constants";
|
import { EquicordDevs } from "@utils/constants";
|
||||||
|
@ -125,13 +125,8 @@ const RenderStatusMenuItem = ({ status, update, disabled }: { status: DiscordSta
|
||||||
|
|
||||||
|
|
||||||
const StatusSubMenuComponent = () => {
|
const StatusSubMenuComponent = () => {
|
||||||
let premiumType;
|
|
||||||
if (Settings.plugins.NoNitroUpsell?.enabled) {
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
premiumType = UserStore?.getCurrentUser()?._realPremiumType ?? UserStore?.getCurrentUser()?.premiumType ?? 0;
|
const premiumType = UserStore?.getCurrentUser()?._realPremiumType ?? UserStore?.getCurrentUser()?.premiumType ?? 0;
|
||||||
} else {
|
|
||||||
premiumType = UserStore?.getCurrentUser()?.premiumType ?? 0;
|
|
||||||
}
|
|
||||||
const update = useForceUpdater();
|
const update = useForceUpdater();
|
||||||
return <Menu.Menu navId="sp-custom-status-submenu" onClose={() => { }}>
|
return <Menu.Menu navId="sp-custom-status-submenu" onClose={() => { }}>
|
||||||
{Object.entries((settings.store.StatusPresets as { [k: string]: DiscordStatus | undefined; })).map(([index, status]) => status != null ? <Menu.MenuItem
|
{Object.entries((settings.store.StatusPresets as { [k: string]: DiscordStatus | undefined; })).map(([index, status]) => status != null ? <Menu.MenuItem
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { addMessagePreEditListener, addMessagePreSendListener, removeMessagePreEditListener, removeMessagePreSendListener } from "@api/MessageEvents";
|
import { addMessagePreEditListener, addMessagePreSendListener, removeMessagePreEditListener, removeMessagePreSendListener } from "@api/MessageEvents";
|
||||||
import { definePluginSettings, Settings } from "@api/Settings";
|
import { definePluginSettings } from "@api/Settings";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
import { ApngBlendOp, ApngDisposeOp, importApngJs } from "@utils/dependencies";
|
import { ApngBlendOp, ApngDisposeOp, importApngJs } from "@utils/dependencies";
|
||||||
import { getCurrentGuild, getEmojiURL } from "@utils/discord";
|
import { getCurrentGuild, getEmojiURL } from "@utils/discord";
|
||||||
|
@ -30,13 +30,8 @@ import type { Message } from "discord-types/general";
|
||||||
import { applyPalette, GIFEncoder, quantize } from "gifenc";
|
import { applyPalette, GIFEncoder, quantize } from "gifenc";
|
||||||
import type { ReactElement, ReactNode } from "react";
|
import type { ReactElement, ReactNode } from "react";
|
||||||
|
|
||||||
let premiumType;
|
|
||||||
if (Settings.plugins.NoNitroUpsell?.enabled) {
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
premiumType = UserStore?.getCurrentUser()?._realPremiumType ?? UserStore?.getCurrentUser()?.premiumType ?? 0;
|
const premiumType = UserStore?.getCurrentUser()?._realPremiumType ?? UserStore?.getCurrentUser()?.premiumType ?? 0;
|
||||||
} else {
|
|
||||||
premiumType = UserStore?.getCurrentUser()?.premiumType ?? 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const StickerStore = findStoreLazy("StickersStore") as {
|
const StickerStore = findStoreLazy("StickersStore") as {
|
||||||
getPremiumPacks(): StickerPack[];
|
getPremiumPacks(): StickerPack[];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue