1
0
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:
Arik Chakma
2025-05-16 00:18:59 +06:00
parent 044c3e3574
commit 8cd96074e8

View File

@@ -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]);