chore: update upgrade card visibility logic to ensure data is loaded before rendering
This commit is contained in:
parent
1e1cafff32
commit
c66fedea27
@ -35,7 +35,13 @@ export function UpgradeCard() {
|
|||||||
const isMember =
|
const isMember =
|
||||||
paymentData?.currentPlan?.isLifetime || !!paymentData?.subscription;
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user