fix: do not load checkout for logged out users

This commit is contained in:
thecodrr
2021-11-23 19:13:17 +05:00
parent 0dc6287c08
commit db3e10bbb0

View File

@@ -379,20 +379,24 @@ function BuyDialog(props) {
<TryForFree />
)}
</Flex>
{selectedPlan ? (
<Checkout
user={user}
plan={selectedPlan}
onCheckoutLoaded={(data) => {
const pricingInfo = getPricingInfoFromCheckout(
selectedPlan,
data
);
console.log(pricingInfo, selectedPlan.coupon);
setDiscount(pricingInfo);
}}
/>
) : plan ? null : (
{isLoggedIn ? (
selectedPlan ? (
<Checkout
user={user}
plan={selectedPlan}
onCheckoutLoaded={(data) => {
const pricingInfo = getPricingInfoFromCheckout(
selectedPlan,
data
);
console.log(pricingInfo, selectedPlan.coupon);
setDiscount(pricingInfo);
}}
/>
) : plan ? null : (
<FeaturesList />
)
) : (
<FeaturesList />
)}
</Flex>