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