Merge pull request #1761 from appwrite/fix-order

Fix: upgrade, downgrade checks on non-public and same plans
This commit is contained in:
Darshan authored and GitHub committed 2025-03-23 13:50:45 +05:30
commit fd363ae309
1 file changed
+4 -4
@@ -274,12 +274,12 @@
}
}
$: isUpgrade = $plansInfo.get(billingPlan).order > $currentPlan.order;
$: isDowngrade = $plansInfo.get(billingPlan).order < $currentPlan.order;
$: isSamePlan = billingPlan === $currentPlan.$id;
$: isUpgrade = isSamePlan ? false : $plansInfo.get(billingPlan)?.order > $currentPlan.order;
$: isDowngrade = isSamePlan ? false : $plansInfo.get(billingPlan)?.order < $currentPlan.order;
$: if (billingPlan !== BillingPlan.FREE) {
loadPaymentMethods();
}
$: isButtonDisabled = ($currentPlan?.$id as Tier) === billingPlan;
</script>
<svelte:head>
@@ -387,7 +387,7 @@
<Button
fullWidthMobile
on:click={() => formComponent.triggerSubmit()}
disabled={$isSubmitting || isButtonDisabled || !selfService}>
disabled={$isSubmitting || isSamePlan || !selfService}>
Change plan
</Button>
</WizardSecondaryFooter>