From c66fedea273dab22402dff6bda6a1a9ba336ac5a Mon Sep 17 00:00:00 2001 From: javayhu Date: Sat, 23 Aug 2025 07:51:37 +0800 Subject: [PATCH] chore: update upgrade card visibility logic to ensure data is loaded before rendering --- src/components/dashboard/upgrade-card.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/dashboard/upgrade-card.tsx b/src/components/dashboard/upgrade-card.tsx index 6807aa0..d42431d 100644 --- a/src/components/dashboard/upgrade-card.tsx +++ b/src/components/dashboard/upgrade-card.tsx @@ -35,7 +35,13 @@ export function UpgradeCard() { const isMember = paymentData?.currentPlan?.isLifetime || !!paymentData?.subscription; - if (!mounted || isLoading || isMember) { + // Ensure the upgrade card is only shown when the data is loaded + if (!mounted || isLoading || !paymentData) { + return null; + } + + // If the user is a member, don't show the upgrade card + if (isMember) { return null; }