mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
[web] fix bug where pending downgrades are removed when subscriptions change (#30420)
* preserve pending changes when generating change requests * re-apply pending term_end changes after immediate updates * block changes when Stripe subscription has multiple phases * handle MultiplePendingChangesError & rm PendingChangeError GitOrigin-RevId: 0af11044766ff48e683d684ad6d62b732d17290c
This commit is contained in:
+1
-1
@@ -368,7 +368,7 @@ function FlexibleGroupLicensingActions({
|
||||
}) {
|
||||
const { t } = useTranslation()
|
||||
|
||||
if (subscription.pendingPlan || subscription.payment.hasPastDueInvoice) {
|
||||
if (subscription.payment.hasPastDueInvoice) {
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
+10
-8
@@ -38,22 +38,24 @@ function KeepCurrentPlanButton() {
|
||||
function ChangePlanButton({ plan }: { plan: Plan }) {
|
||||
const { t } = useTranslation()
|
||||
const { personalSubscription } = useSubscriptionDashboardContext()
|
||||
const currentPlanCode = personalSubscription?.planCode?.split('_')[0]
|
||||
const pendingPlanCode =
|
||||
personalSubscription?.pendingPlan?.planCode?.split('_')[0]
|
||||
const isCurrentPlanForUser =
|
||||
personalSubscription?.planCode &&
|
||||
plan.planCode === personalSubscription.planCode.split('_')[0]
|
||||
currentPlanCode && plan.planCode === currentPlanCode
|
||||
|
||||
if (isCurrentPlanForUser) {
|
||||
if (pendingPlanCode && pendingPlanCode !== currentPlanCode) {
|
||||
return <KeepCurrentPlanButton />
|
||||
}
|
||||
|
||||
if (isCurrentPlanForUser && personalSubscription.pendingPlan) {
|
||||
return <KeepCurrentPlanButton />
|
||||
} else if (isCurrentPlanForUser && !personalSubscription.pendingPlan) {
|
||||
return (
|
||||
<b className="d-inline-flex align-items-center">
|
||||
<MaterialIcon type="check" />
|
||||
{t('your_plan')}
|
||||
</b>
|
||||
)
|
||||
} else if (
|
||||
personalSubscription?.pendingPlan?.planCode?.split('_')[0] === plan.planCode
|
||||
) {
|
||||
} else if (pendingPlanCode === plan.planCode) {
|
||||
return (
|
||||
<b className="d-inline-flex align-items-center">
|
||||
<MaterialIcon type="check" />
|
||||
|
||||
Reference in New Issue
Block a user