From db3e10bbb0c648d50563cb74872e02bab75ab1be Mon Sep 17 00:00:00 2001 From: thecodrr Date: Tue, 23 Nov 2021 19:13:17 +0500 Subject: [PATCH] fix: do not load checkout for logged out users --- apps/web/src/components/dialogs/buydialog.js | 32 +++++++++++--------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/apps/web/src/components/dialogs/buydialog.js b/apps/web/src/components/dialogs/buydialog.js index 30e9dbbb1..b6578a588 100644 --- a/apps/web/src/components/dialogs/buydialog.js +++ b/apps/web/src/components/dialogs/buydialog.js @@ -379,20 +379,24 @@ function BuyDialog(props) { )} - {selectedPlan ? ( - { - const pricingInfo = getPricingInfoFromCheckout( - selectedPlan, - data - ); - console.log(pricingInfo, selectedPlan.coupon); - setDiscount(pricingInfo); - }} - /> - ) : plan ? null : ( + {isLoggedIn ? ( + selectedPlan ? ( + { + const pricingInfo = getPricingInfoFromCheckout( + selectedPlan, + data + ); + console.log(pricingInfo, selectedPlan.coupon); + setDiscount(pricingInfo); + }} + /> + ) : plan ? null : ( + + ) + ) : ( )}