Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

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

vishnukvmdba314eb647c9
diff --git a/web/apps/photos/src/components/Sidebar/SubscriptionStatus/index.tsx b/web/apps/photos/src/components/Sidebar/SubscriptionStatus/index.tsx
index b127c15973..9ae19f640f 100644
--- a/web/apps/photos/src/components/Sidebar/SubscriptionStatus/index.tsx
+++ b/web/apps/photos/src/components/Sidebar/SubscriptionStatus/index.tsx
@@ -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();