π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Inline
Manav Rathi8225070dd3f3
diff --git a/web/apps/photos/src/components/pages/gallery/PlanSelector.tsx b/web/apps/photos/src/components/pages/gallery/PlanSelector.tsxindex 4a6f2933d1..87fec1bb44 100644--- a/web/apps/photos/src/components/pages/gallery/PlanSelector.tsx+++ b/web/apps/photos/src/components/pages/gallery/PlanSelector.tsx@@ -55,10 +55,8 @@ import {hasPaidSubscription,hasStripeSubscription,isOnFreePlan,- isPopularPlan,isSubscriptionActive,isSubscriptionCancelled,- isUserSubscribedPlan,planSelectionOutcome,} from "utils/billing";@@ -508,6 +506,18 @@ const Plans = ({);};+function isUserSubscribedPlan(plan: Plan, subscription: Subscription) {+ return (+ isSubscriptionActive(subscription) &&+ (plan.stripeID === subscription.productID ||+ plan.iosID === subscription.productID ||+ plan.androidID === subscription.productID)+ );+}++const isPopularPlan = (plan: Plan) =>+ plan.storage === 100 * 1024 * 1024 * 1024; /* 100 GB */+interface PlanRowProps {plan: Plan;subscription: Subscription;diff --git a/web/apps/photos/src/utils/billing/index.ts b/web/apps/photos/src/utils/billing/index.tsindex b3cb2855a5..0a3b18338c 100644--- a/web/apps/photos/src/utils/billing/index.ts+++ b/web/apps/photos/src/utils/billing/index.ts@@ -8,7 +8,6 @@ import { getData, LS_KEYS } from "@ente/shared/storage/localStorage";import { t } from "i18next";import type { NextRouter } from "next/router";import billingService, {- Plan,redirectToCustomerPortal,Subscription,} from "services/billingService";@@ -107,14 +106,6 @@ export function getLocalUserSubscription(): Subscription {return getData(LS_KEYS.SUBSCRIPTION);}-export function isUserSubscribedPlan(plan: Plan, subscription: Subscription) {- return (- isSubscriptionActive(subscription) &&- (plan.stripeID === subscription.productID ||- plan.iosID === subscription.productID ||- plan.androidID === subscription.productID)- );-}export function hasStripeSubscription(subscription: Subscription) {return subscription.paymentProvider == "stripe";}@@ -141,9 +132,6 @@ export function isSubscriptionPastDue(subscription: Subscription) {);}-export const isPopularPlan = (plan: Plan) =>- plan.storage === 100 * 1024 * 1024 * 1024; /* 100 GB */-/*** When the payments app redirects back to us after a plan purchase or update* completes, it sets various query parameters to relay the status of the action