[web] Handle past-due state on clicking "renew"

This commit is contained in:
vishnukvmd 2024-03-27 16:17:23 +05:30
parent 1020366c3a
commit ba314eb647

View file

@ -12,6 +12,7 @@ import {
isOnFreePlan,
isSubscriptionActive,
isSubscriptionCancelled,
isSubscriptionPastDue,
} from "utils/billing";
import { Typography } from "@mui/material";
@ -54,7 +55,10 @@ export default function SubscriptionStatus({
showPlanSelectorModal();
}
} else {
if (hasStripeSubscription(userDetails.subscription)) {
if (
hasStripeSubscription(userDetails.subscription) &&
isSubscriptionPastDue(userDetails.subscription)
) {
billingService.redirectToCustomerPortal();
} else {
showPlanSelectorModal();