diff --git a/src/client/AccountModal.ts b/src/client/AccountModal.ts index 08f4f6fdc..e1aa2f0d1 100644 --- a/src/client/AccountModal.ts +++ b/src/client/AccountModal.ts @@ -21,7 +21,7 @@ import "./components/Difficulties"; import "./components/FriendsList"; import "./components/SubscriptionPanel"; import { modalHeader } from "./components/ui/ModalHeader"; -import { fetchCosmetics } from "./Cosmetics"; +import { fetchCosmetics, SUBSCRIPTIONS_ENABLED } from "./Cosmetics"; import { translateText } from "./Utils"; @customElement("account-modal") @@ -32,9 +32,9 @@ export class AccountModal extends BaseModal { @state() private isLoadingUser: boolean = false; private userMeResponse: UserMeResponse | null = null; + private cosmetics: Cosmetics | null = null; private statsTree: PlayerStatsTree | null = null; private recentGames: PlayerGame[] = []; - private cosmetics: Cosmetics | null = null; constructor() { super(); @@ -225,6 +225,7 @@ export class AccountModal extends BaseModal { } private renderSubscriptionPanel(): TemplateResult | "" { + if (!SUBSCRIPTIONS_ENABLED) return ""; const sub = this.userMeResponse?.player?.subscription; if (!sub) return ""; const cosmetic = this.cosmetics?.subscriptions?.[sub.tier] ?? null; @@ -419,10 +420,12 @@ export class AccountModal extends BaseModal { protected onOpen(): void { this.isLoadingUser = true; - void fetchCosmetics().then((cosmetics) => { - this.cosmetics = cosmetics; - this.requestUpdate(); - }); + if (SUBSCRIPTIONS_ENABLED) { + void fetchCosmetics().then((cosmetics) => { + this.cosmetics = cosmetics; + this.requestUpdate(); + }); + } void getUserMe() .then((userMe) => { diff --git a/src/client/Cosmetics.ts b/src/client/Cosmetics.ts index 2ba0a3db9..42c5e1c62 100644 --- a/src/client/Cosmetics.ts +++ b/src/client/Cosmetics.ts @@ -29,6 +29,10 @@ import { translateText } from "./Utils"; export const TEMP_FLARE_OFFSET = 1 * 60 * 1000; // 1 minute +// Subscriptions are not ready yet — flip to true to show them in the store +// and on the account/profile modal. +export const SUBSCRIPTIONS_ENABLED = false; + let __cosmetics: Promise | null = null; let __cosmeticsHash: string | null = null; let __cosmeticsCache: Cosmetics | null = null; diff --git a/src/client/Store.ts b/src/client/Store.ts index a239860c4..7189ebf6c 100644 --- a/src/client/Store.ts +++ b/src/client/Store.ts @@ -12,6 +12,7 @@ import { fetchCosmetics, purchaseCosmetic, resolveCosmetics, + SUBSCRIPTIONS_ENABLED, } from "./Cosmetics"; import { translateText } from "./Utils"; @@ -32,7 +33,14 @@ export class StoreModal extends BaseModal { return { tabs: [ { key: "packs", label: translateText("store.packs") }, - { key: "subscriptions", label: translateText("store.subscriptions") }, + ...(SUBSCRIPTIONS_ENABLED + ? [ + { + key: "subscriptions", + label: translateText("store.subscriptions"), + }, + ] + : []), { key: "patterns", label: translateText("store.patterns") }, { key: "flags", label: translateText("store.flags") }, ],