mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 07:40:43 +00:00
Hide subscriptions in store and account modal behind a feature flag
Subscriptions aren't ready yet. Add SUBSCRIPTIONS_ENABLED (currently false) in Cosmetics.ts to gate the Subscriptions store tab, the subscription panel on the account modal, and its cosmetics fetch. Flip the flag to true to re-enable.
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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<Cosmetics | null> | null = null;
|
||||
let __cosmeticsHash: string | null = null;
|
||||
let __cosmeticsCache: Cosmetics | null = null;
|
||||
|
||||
+9
-1
@@ -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") },
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user