diff --git a/packages/dashboard/src/pages/payments.js b/packages/dashboard/src/pages/payments.js index c1cd9870..628b780f 100644 --- a/packages/dashboard/src/pages/payments.js +++ b/packages/dashboard/src/pages/payments.js @@ -42,6 +42,7 @@ const ActiveBadge = () => { }; export default function Payments() { + const { data: user } = useSWR("/user", fetcher); const [selectedPlanId, setSelectedPlanId] = useState("initial_free"); const selectedPlan = plans.find(({ id }) => selectedPlanId === id); const handleSubscribe = async () => { @@ -143,12 +144,14 @@ export default function Payments() { -
- To manage your active subscription, payment methods and view your billing history, go to{" "} - - Stripe Customer Portal - -
+ {Boolean(user?.stripeCustomerId) && ( +
+ To manage your active subscription, payment methods and view your billing history, go to{" "} + + Stripe Customer Portal + +
+ )}