Fin
This commit is contained in:
@@ -13,7 +13,6 @@ import {
|
||||
convertBase64ToBuffer,
|
||||
convertBufferToBase64,
|
||||
} from "@ente/accounts/utils";
|
||||
import { appNameToAppNameOld } 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";
|
||||
@@ -39,8 +38,6 @@ import type { PageProps } from "../types/page";
|
||||
const Page: React.FC<PageProps> = ({ appContext }) => {
|
||||
const { appName } = appContext;
|
||||
|
||||
const appNameOld = appNameToAppNameOld(appName);
|
||||
|
||||
const [token, setToken] = useState<string>();
|
||||
const [user, setUser] = useState<User>();
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { isDevBuild } from "@/next/env";
|
||||
import log from "@/next/log";
|
||||
import { ensure } from "@/utils/ensure";
|
||||
import { APP_HOMES, appNameToAppNameOld } from "@ente/shared/apps/constants";
|
||||
import { VerticallyCentered } from "@ente/shared/components/Container";
|
||||
import EnteSpinner from "@ente/shared/components/EnteSpinner";
|
||||
import FormPaper from "@ente/shared/components/Form/FormPaper";
|
||||
@@ -45,6 +44,7 @@ import { useRouter } from "next/router";
|
||||
import { useEffect, useState } from "react";
|
||||
import { getSRPAttributes } from "../api/srp";
|
||||
import { PAGES } from "../constants/pages";
|
||||
import { appHomeRoute } from "../services/redirect";
|
||||
import {
|
||||
configureSRP,
|
||||
generateSRPSetupAttributes,
|
||||
@@ -56,8 +56,6 @@ import type { SRPAttributes } from "../types/srp";
|
||||
const Page: React.FC<PageProps> = ({ appContext }) => {
|
||||
const { appName, logout } = appContext;
|
||||
|
||||
const appNameOld = appNameToAppNameOld(appName);
|
||||
|
||||
const [srpAttributes, setSrpAttributes] = useState<SRPAttributes>();
|
||||
const [keyAttributes, setKeyAttributes] = useState<KeyAttributes>();
|
||||
const [user, setUser] = useState<User>();
|
||||
@@ -89,8 +87,7 @@ const Page: React.FC<PageProps> = ({ appContext }) => {
|
||||
}
|
||||
const token = getToken();
|
||||
if (key && token) {
|
||||
// TODO: Refactor the type of APP_HOMES to not require the ??
|
||||
router.push(APP_HOMES.get(appNameOld) ?? "/");
|
||||
router.push(appHomeRoute(appName));
|
||||
return;
|
||||
}
|
||||
const kekEncryptedAttributes: B64EncryptionResult = getKey(
|
||||
@@ -250,7 +247,7 @@ const Page: React.FC<PageProps> = ({ appContext }) => {
|
||||
}
|
||||
const redirectURL = InMemoryStore.get(MS_KEYS.REDIRECT_URL);
|
||||
InMemoryStore.delete(MS_KEYS.REDIRECT_URL);
|
||||
router.push(redirectURL ?? APP_HOMES.get(appNameOld));
|
||||
router.push(redirectURL ?? appHomeRoute(appName));
|
||||
} catch (e) {
|
||||
log.error("useMasterPassword failed", e);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import SetPasswordForm, {
|
||||
import { PAGES } from "@ente/accounts/constants/pages";
|
||||
import { configureSRP } from "@ente/accounts/services/srp";
|
||||
import { generateKeyAndSRPAttributes } from "@ente/accounts/utils/srp";
|
||||
import { appNameToAppNameOld } from "@ente/shared/apps/constants";
|
||||
import { VerticallyCentered } from "@ente/shared/components/Container";
|
||||
import EnteSpinner from "@ente/shared/components/EnteSpinner";
|
||||
import FormPaper from "@ente/shared/components/Form/FormPaper";
|
||||
@@ -35,8 +34,6 @@ import type { PageProps } from "../types/page";
|
||||
const Page: React.FC<PageProps> = ({ appContext }) => {
|
||||
const { appName, logout } = appContext;
|
||||
|
||||
const appNameOld = appNameToAppNameOld(appName);
|
||||
|
||||
const [token, setToken] = useState<string>();
|
||||
const [user, setUser] = useState<User>();
|
||||
const [recoverModalView, setRecoveryModalView] = useState(false);
|
||||
|
||||
@@ -6,7 +6,6 @@ import VerifyTwoFactor, {
|
||||
} from "@ente/accounts/components/two-factor/VerifyForm";
|
||||
import { TwoFactorSetup } from "@ente/accounts/components/two-factor/setup";
|
||||
import type { TwoFactorSecret } from "@ente/accounts/types/user";
|
||||
import { appNameToAppNameOld } from "@ente/shared/apps/constants";
|
||||
import { VerticallyCentered } from "@ente/shared/components/Container";
|
||||
import LinkButton from "@ente/shared/components/LinkButton";
|
||||
import { encryptWithRecoveryKey } from "@ente/shared/crypto/helpers";
|
||||
@@ -27,8 +26,6 @@ export enum SetupMode {
|
||||
const Page: React.FC<PageProps> = ({ appContext }) => {
|
||||
const { appName } = appContext;
|
||||
|
||||
const appNameOld = appNameToAppNameOld(appName);
|
||||
|
||||
const [twoFactorSecret, setTwoFactorSecret] = useState<
|
||||
TwoFactorSecret | undefined
|
||||
>();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { ensure } from "@/utils/ensure";
|
||||
import type { UserVerificationResponse } from "@ente/accounts/types/user";
|
||||
import { appNameToAppNameOld } from "@ente/shared/apps/constants";
|
||||
import { VerticallyCentered } from "@ente/shared/components/Container";
|
||||
import EnteSpinner from "@ente/shared/components/EnteSpinner";
|
||||
import FormPaper from "@ente/shared/components/Form/FormPaper";
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import type { AppName } from "@/next/types/app";
|
||||
import { ACCOUNTS_PAGES, AUTH_PAGES, PHOTOS_PAGES } from "../constants/pages";
|
||||
|
||||
export enum APPS {
|
||||
PHOTOS = "PHOTOS",
|
||||
@@ -25,9 +24,3 @@ export const CLIENT_PACKAGE_NAMES = new Map([
|
||||
]);
|
||||
|
||||
export const clientPackageNamePhotosDesktop = "io.ente.photos.desktop";
|
||||
|
||||
export const APP_HOMES = new Map([
|
||||
[APPS.PHOTOS, PHOTOS_PAGES.GALLERY as string],
|
||||
[APPS.AUTH, AUTH_PAGES.AUTH],
|
||||
[APPS.ACCOUNTS, ACCOUNTS_PAGES.PASSKEYS],
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user