From 19f18fe03239e18edfd383b4c4af4fc71a55d922 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Mon, 9 Sep 2024 14:02:14 +0530 Subject: [PATCH] Inline --- .../photos/src/components/pages/gallery/PlanSelector.tsx | 5 ++--- web/apps/photos/src/constants/redirects.ts | 9 --------- web/apps/photos/src/utils/billing/index.ts | 4 +--- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/web/apps/photos/src/components/pages/gallery/PlanSelector.tsx b/web/apps/photos/src/components/pages/gallery/PlanSelector.tsx index c016bbe0dd..859a2d3cc0 100644 --- a/web/apps/photos/src/components/pages/gallery/PlanSelector.tsx +++ b/web/apps/photos/src/components/pages/gallery/PlanSelector.tsx @@ -1,5 +1,6 @@ import log from "@/base/log"; import { bytesInGB, formattedStorageByteSize } from "@/new/photos/utils/units"; +import { openURL } from "@/new/photos/utils/web"; import { FlexWrapper, FluidContainer, @@ -46,7 +47,6 @@ import { isSubscriptionActive, isSubscriptionCancelled, isUserSubscribedPlan, - manageFamilyMethod, planForSubscription, planSelectionOutcome, updatePaymentMethod, @@ -686,9 +686,8 @@ function ManageSubscription({ closeModal, setLoading, }: ManageSubscriptionProps) { - const appContext = useContext(AppContext); const openFamilyPortal = () => - manageFamilyMethod(appContext.setDialogMessage, setLoading); + openURL("https://web.ente.io?redirect=families"); return ( diff --git a/web/apps/photos/src/constants/redirects.ts b/web/apps/photos/src/constants/redirects.ts index 92b5cd1b87..e69de29bb2 100644 --- a/web/apps/photos/src/constants/redirects.ts +++ b/web/apps/photos/src/constants/redirects.ts @@ -1,9 +0,0 @@ -export enum REDIRECTS { - FAMILIES = "families", -} - -export const getRedirectURL = (redirect: REDIRECTS) => { - const url = new URL("https://web.ente.io"); - url.searchParams.set("redirect", redirect); - return url.href; -}; diff --git a/web/apps/photos/src/utils/billing/index.ts b/web/apps/photos/src/utils/billing/index.ts index 50366e0407..7fd9937ab9 100644 --- a/web/apps/photos/src/utils/billing/index.ts +++ b/web/apps/photos/src/utils/billing/index.ts @@ -2,7 +2,6 @@ import log from "@/base/log"; import { openURL } from "@/new/photos/utils/web"; import { SetDialogBoxAttributes } from "@ente/shared/components/DialogBox/types"; import { LS_KEYS, getData } from "@ente/shared/storage/localStorage"; -import { REDIRECTS, getRedirectURL } from "constants/redirects"; import { t } from "i18next"; import type { NextRouter } from "next/router"; import billingService from "services/billingService"; @@ -253,8 +252,7 @@ export async function manageFamilyMethod( ) { try { setLoading(true); - const familyPortalRedirectURL = getRedirectURL(REDIRECTS.FAMILIES); - openURL(familyPortalRedirectURL); + ; } catch (e) { log.error("failed to redirect to family portal", e); setDialogMessage({