From a65ebacfbd885c72fd104369e04e21c827efc66d Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Wed, 5 Jun 2024 13:51:12 +0530 Subject: [PATCH] Fix --- web/packages/accounts/pages/recover.tsx | 5 ++--- web/packages/accounts/services/redirect.ts | 4 +--- web/packages/next/types/app.ts | 3 +-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/web/packages/accounts/pages/recover.tsx b/web/packages/accounts/pages/recover.tsx index afc528136c..b6120697d9 100644 --- a/web/packages/accounts/pages/recover.tsx +++ b/web/packages/accounts/pages/recover.tsx @@ -2,7 +2,6 @@ import log from "@/next/log"; import { ensure } from "@/utils/ensure"; import { sendOtt } from "@ente/accounts/api/user"; import { PAGES } from "@ente/accounts/constants/pages"; -import { APP_HOMES } from "@ente/shared/apps/constants"; import { VerticallyCentered } from "@ente/shared/components/Container"; import FormPaper from "@ente/shared/components/Form/FormPaper"; import FormPaperFooter from "@ente/shared/components/Form/FormPaper/Footer"; @@ -23,6 +22,7 @@ import type { KeyAttributes, User } from "@ente/shared/user/types"; import { t } from "i18next"; import { useRouter } from "next/router"; import { useEffect, useState } from "react"; +import { appHomeRoute } from "../services/redirect"; import type { PageProps } from "../types/page"; const bip39 = require("bip39"); @@ -55,8 +55,7 @@ const Page: React.FC = ({ appContext }) => { if (!keyAttributes) { router.push(PAGES.GENERATE); } else if (key) { - // TODO: Refactor the type of APP_HOMES to not require the ?? - router.push(APP_HOMES.get(appNameOld) ?? "/"); + router.push(appHomeRoute(appName)); } else { setKeyAttributes(keyAttributes); } diff --git a/web/packages/accounts/services/redirect.ts b/web/packages/accounts/services/redirect.ts index 01b6ddfb4f..2b3f704956 100644 --- a/web/packages/accounts/services/redirect.ts +++ b/web/packages/accounts/services/redirect.ts @@ -6,7 +6,7 @@ import { } from "@ente/shared/constants/pages"; /** - * The "home" route for each of our apps. + * The default page ("home route") for each of our apps. * * This is where we redirect to after successful authentication. */ @@ -14,8 +14,6 @@ export const appHomeRoute = (appName: AppName): string => { switch (appName) { case "accounts": return ACCOUNTS_PAGES.PASSKEYS; - case "albums": - return "/"; case "auth": return AUTH_PAGES.AUTH; case "photos": diff --git a/web/packages/next/types/app.ts b/web/packages/next/types/app.ts index 48ee160120..40a01481f2 100644 --- a/web/packages/next/types/app.ts +++ b/web/packages/next/types/app.ts @@ -4,7 +4,7 @@ import type { DialogBoxAttributesV2 } from "@ente/shared/components/DialogBoxV2/ * Arbitrary names that we used as keys for indexing various constants * corresponding to our apps that rely on this package. */ -export type AppName = "accounts" | "albums" | "auth" | "photos"; +export type AppName = "accounts" | "auth" | "photos"; /** * Static title for the app. @@ -13,7 +13,6 @@ export type AppName = "accounts" | "albums" | "auth" | "photos"; */ export const appTitle: Record = { accounts: "Ente Accounts", - albums: "Ente Albums", auth: "Ente Auth", photos: "Ente Photos", };