cp
This commit is contained in:
parent
ca00b3b558
commit
3a5311cdcc
|
@ -13,7 +13,7 @@ import {
|
||||||
convertBase64ToBuffer,
|
convertBase64ToBuffer,
|
||||||
convertBufferToBase64,
|
convertBufferToBase64,
|
||||||
} from "@ente/accounts/utils";
|
} from "@ente/accounts/utils";
|
||||||
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 FormPaper from "@ente/shared/components/Form/FormPaper";
|
import FormPaper from "@ente/shared/components/Form/FormPaper";
|
||||||
|
@ -35,7 +35,11 @@ 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 ChangePassword({ appName }: PageProps) {
|
const Page: React.FC<PageProps> = ({ appContext }) => {
|
||||||
|
const { appName } = 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>();
|
||||||
|
|
||||||
|
@ -123,7 +127,7 @@ export default function ChangePassword({ appName }: PageProps) {
|
||||||
const redirectToAppHome = () => {
|
const redirectToAppHome = () => {
|
||||||
setData(LS_KEYS.SHOW_BACK_BUTTON, { value: true });
|
setData(LS_KEYS.SHOW_BACK_BUTTON, { value: true });
|
||||||
// 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: Handle the case where user is not loaded yet.
|
// TODO: Handle the case where user is not loaded yet.
|
||||||
|
@ -146,4 +150,6 @@ export default function ChangePassword({ appName }: PageProps) {
|
||||||
</FormPaper>
|
</FormPaper>
|
||||||
</VerticallyCentered>
|
</VerticallyCentered>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
|
export default Page;
|
||||||
|
|
Loading…
Reference in a new issue