Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

hide trial / none plans from the list

Blue Mousef7992fe7be00
diff --git a/web/app/components/pricing/BillingPricing.tsx b/web/app/components/pricing/BillingPricing.tsx
index baf6c49d4..9516c87ca 100644
--- a/web/app/components/pricing/BillingPricing.tsx
+++ b/web/app/components/pricing/BillingPricing.tsx
@@ -57,15 +57,18 @@ const BillingPricing = ({ lastEvent }: BillingPricingProps) => {
const [showDowngradeModal, setShowDowngradeModal] = useState(false)
const [billingFrequency, setBillingFrequency] = useState(user?.billingFrequency || BillingFrequency.monthly)
- const PLAN_CODES_ARRAY = useMemo(
- () =>
- isAuthenticated
- ? _includes(STANDARD_PLANS, user?.planCode)
- ? STANDARD_PLANS
- : [user?.planCode, ...STANDARD_PLANS]
- : STANDARD_PLANS,
- [isAuthenticated, user?.planCode],
- )
+ const PLAN_CODES_ARRAY = useMemo(() => {
+ if (!isAuthenticated) return STANDARD_PLANS
+
+ const userPlan = user?.planCode
+
+ // Hide non-purchasable pseudo-plans from the list
+ if (userPlan === 'trial' || userPlan === 'none') {
+ return STANDARD_PLANS
+ }
+
+ return _includes(STANDARD_PLANS, userPlan) ? STANDARD_PLANS : [userPlan, ...STANDARD_PLANS]
+ }, [isAuthenticated, user?.planCode])
const currencyCode = user?.tierCurrency || metainfo.code
const currency = CURRENCIES[currencyCode]