chore: update upgrade card visibility logic to ensure data is loaded before rendering

This commit is contained in:
javayhu 2025-08-23 07:51:37 +08:00
parent 1e1cafff32
commit c66fedea27

View File

@ -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;
}