This commit is contained in:
Manav Rathi
2024-09-09 14:02:14 +05:30
parent 9bf4edecdb
commit 19f18fe032
3 changed files with 3 additions and 15 deletions

View File

@@ -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 (
<Stack spacing={1}>

View File

@@ -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;
};

View File

@@ -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({