Files
Verso/services/web/frontend/js/features/subscription/util/show-downgrade-option.ts
T
roo huttonandCopybot 50f5a4e909 Merge pull request #23161 from overleaf/rh-pause-no-plan-change
Prevent downgrade to personal plan during subscription pause

GitOrigin-RevId: e3ba2e8e4d9b909fa2ee9c3c7e15db2ed257e43b
2025-01-31 09:04:58 +00:00

19 lines
522 B
TypeScript

import { Nullable } from '../../../../../types/utils'
import isInFreeTrial from './is-in-free-trial'
import isMonthlyCollaboratorPlan from './is-monthly-collaborator-plan'
export default function showDowngradeOption(
planCode: string,
isGroupPlan?: boolean,
trialEndsAt?: string | null,
pausedAt?: Nullable<string>,
remainingPauseCycles?: Nullable<number>
) {
return (
!pausedAt &&
!remainingPauseCycles &&
isMonthlyCollaboratorPlan(planCode, isGroupPlan) &&
!isInFreeTrial(trialEndsAt)
)
}