From 672865c062acf59338124d73c0a106d052f298ee Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Mon, 9 Sep 2024 14:28:23 +0530 Subject: [PATCH] Remove double redirection --- .../src/components/pages/gallery/PlanSelector.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/web/apps/photos/src/components/pages/gallery/PlanSelector.tsx b/web/apps/photos/src/components/pages/gallery/PlanSelector.tsx index 859a2d3cc0..2f06953af9 100644 --- a/web/apps/photos/src/components/pages/gallery/PlanSelector.tsx +++ b/web/apps/photos/src/components/pages/gallery/PlanSelector.tsx @@ -32,6 +32,7 @@ import { GalleryContext } from "pages/gallery"; import { useContext, useEffect, useMemo, useState } from "react"; import { Trans } from "react-i18next"; import billingService, { type PlansResponse } from "services/billingService"; +import { getFamilyPortalRedirectURL } from "services/userService"; import { Plan, Subscription } from "types/billing"; import { SetLoading } from "types/gallery"; import { BonusData } from "types/user"; @@ -686,8 +687,15 @@ function ManageSubscription({ closeModal, setLoading, }: ManageSubscriptionProps) { - const openFamilyPortal = () => - openURL("https://web.ente.io?redirect=families"); + const openFamilyPortal = async () => { + setLoading(true); + try { + openURL(await getFamilyPortalRedirectURL()); + } catch (e) { + log.error("Could not redirect to family portal", e); + } + setLoading(false); + }; return (