This commit is contained in:
Manav Rathi 2024-05-26 18:23:55 +05:30
parent b99c573d3a
commit 17b49595a0
No known key found for this signature in database

View file

@ -7,7 +7,7 @@ import SetPasswordForm, {
import { PAGES } from "@ente/accounts/constants/pages";
import { configureSRP } from "@ente/accounts/services/srp";
import { generateKeyAndSRPAttributes } from "@ente/accounts/utils/srp";
import { APP_HOMES } from "@ente/shared/apps/constants";
import { APP_HOMES, appNameToAppNameOld } from "@ente/shared/apps/constants";
import type { PageProps } from "@ente/shared/apps/types";
import { VerticallyCentered } from "@ente/shared/components/Container";
import EnteSpinner from "@ente/shared/components/EnteSpinner";
@ -31,8 +31,10 @@ import { t } from "i18next";
import { useRouter } from "next/router";
import { useEffect, useState } from "react";
export default function Generate({ appContext, appName }: PageProps) {
const { logout } = appContext;
const Page: React.FC<PageProps> = ({ appContext }) => {
const { appName, logout } = appContext;
const appNameOld = appNameToAppNameOld(appName);
const [token, setToken] = useState<string>();
const [user, setUser] = useState<User>();
@ -57,7 +59,7 @@ export default function Generate({ appContext, appName }: PageProps) {
setLoading(false);
} else {
// TODO: Refactor the type of APP_HOMES to not require the ??
router.push(APP_HOMES.get(appName) ?? "/");
router.push(APP_HOMES.get(appNameOld) ?? "/");
}
} else if (keyAttributes?.encryptedKey) {
router.push(PAGES.CREDENTIALS);
@ -108,7 +110,7 @@ export default function Generate({ appContext, appName }: PageProps) {
onHide={() => {
setRecoveryModalView(false);
// TODO: Refactor the type of APP_HOMES to not require the ??
router.push(APP_HOMES.get(appName) ?? "/");
router.push(APP_HOMES.get(appNameOld) ?? "/");
}}
/* TODO: Why is this error being ignored */
somethingWentWrong={() => {}}
@ -132,4 +134,6 @@ export default function Generate({ appContext, appName }: PageProps) {
)}
</>
);
}
};
export default Page;