mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-09-09 16:53:33 +02:00
fix: price id condition check
This commit is contained in:
@@ -30,20 +30,18 @@ export function VerifyUpgrade(props: VerifyUpgradeProps) {
|
||||
userBillingDetails.status === 'active' &&
|
||||
(newPriceId ? userBillingDetails.priceId === newPriceId : true)
|
||||
) {
|
||||
deleteUrlParam('s');
|
||||
window.location.reload();
|
||||
|
||||
if (newPriceId) {
|
||||
return;
|
||||
if (!newPriceId) {
|
||||
// it means that the user is subscribing for the first time
|
||||
// not changing the plan
|
||||
window?.fireEvent({
|
||||
action: `tutor_purchase_${userBillingDetails.interval === 'month' ? 'mo' : 'an'}`,
|
||||
category: 'ai_tutor',
|
||||
label: `${userBillingDetails.interval} Plan Purchased`,
|
||||
});
|
||||
}
|
||||
|
||||
// it means that the user is subscribing for the first time
|
||||
// not changing the plan
|
||||
window?.fireEvent({
|
||||
action: `tutor_purchase_${userBillingDetails.interval === 'month' ? 'mo' : 'an'}`,
|
||||
category: 'ai_tutor',
|
||||
label: `${userBillingDetails.interval} Plan Purchased`,
|
||||
});
|
||||
deleteUrlParam('s');
|
||||
window.location.reload();
|
||||
}
|
||||
}, [userBillingDetails]);
|
||||
|
||||
|
Reference in New Issue
Block a user