Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Move

Manav Rathi90a0a44ae2f4
diff --git a/web/apps/photos/src/components/Sidebar/Preferences.tsx b/web/apps/photos/src/components/Sidebar/Preferences.tsx
index 1fd9ec89fc..884e9fbde0 100644
--- a/web/apps/photos/src/components/Sidebar/Preferences.tsx
+++ b/web/apps/photos/src/components/Sidebar/Preferences.tsx
@@ -11,7 +11,7 @@ import {
supportedLocales,
type SupportedLocale,
} from "@/base/i18n";
-import { MLSettings } from "@/new/photos/components/MLSettings";
+import { MLSettings } from "@/new/photos/components/sidebar/MLSettings";
import { isMLSupported } from "@/new/photos/services/ml";
import { syncSettings } from "@/new/photos/services/settings";
import { EnteMenuItem } from "@ente/shared/components/Menu/EnteMenuItem";
diff --git a/web/apps/photos/src/components/Sidebar/index.tsx b/web/apps/photos/src/components/Sidebar/index.tsx
index a8536eb46a..1bc7e03fcf 100644
--- a/web/apps/photos/src/components/Sidebar/index.tsx
+++ b/web/apps/photos/src/components/Sidebar/index.tsx
@@ -9,6 +9,7 @@ import log from "@/base/log";
import { savedLogs } from "@/base/log-web";
import { customAPIHost } from "@/base/origins";
import { downloadString } from "@/base/utils/web";
+import { TwoFactorSettings } from "@/new/photos/components/sidebar/TwoFactorSettings";
import { downloadAppDialogAttributes } from "@/new/photos/components/utils/download";
import {
ARCHIVE_SECTION,
@@ -47,7 +48,6 @@ import {
} from "@mui/material";
import Typography from "@mui/material/Typography";
import DeleteAccountModal from "components/DeleteAccountModal";
-import { TwoFactorSettings } from "components/Sidebar/TwoFactorSettings";
import { WatchFolder } from "components/WatchFolder";
import LinkButton from "components/pages/gallery/LinkButton";
import { t } from "i18next";
diff --git a/web/packages/new/photos/components/MLSettings.tsx b/web/packages/new/photos/components/sidebar/MLSettings.tsx
similarity index 97%
rename from web/packages/new/photos/components/MLSettings.tsx
rename to web/packages/new/photos/components/sidebar/MLSettings.tsx
index 21a09ce312..441c14dd61 100644
--- a/web/packages/new/photos/components/MLSettings.tsx
+++ b/web/packages/new/photos/components/sidebar/MLSettings.tsx
@@ -22,10 +22,10 @@ import {
import { t } from "i18next";
import React, { useEffect, useState } from "react";
import { Trans } from "react-i18next";
-import { useAppContext } from "../types/context";
-import { openURL } from "../utils/web";
-import { useMLStatusSnapshot } from "./utils/ml";
-import { useWrapAsyncOperation } from "./utils/use-wrap-async";
+import { useAppContext } from "../../types/context";
+import { openURL } from "../../utils/web";
+import { useMLStatusSnapshot } from "../utils/ml";
+import { useWrapAsyncOperation } from "../utils/use-wrap-async";
export const MLSettings: React.FC<NestedSidebarDrawerVisibilityProps> = ({
open,
diff --git a/web/apps/photos/src/components/Sidebar/TwoFactorSettings.tsx b/web/packages/new/photos/components/sidebar/TwoFactorSettings.tsx
similarity index 89%
rename from web/apps/photos/src/components/Sidebar/TwoFactorSettings.tsx
rename to web/packages/new/photos/components/sidebar/TwoFactorSettings.tsx
index 9b8c5543b5..22f89e4174 100644
--- a/web/apps/photos/src/components/Sidebar/TwoFactorSettings.tsx
+++ b/web/packages/new/photos/components/sidebar/TwoFactorSettings.tsx
@@ -22,24 +22,25 @@ export const TwoFactorSettings: React.FC<
const [isTwoFactorEnabled, setIsTwoFactorEnabled] = useState(false);
useEffect(() => {
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const isTwoFactorEnabled =
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
getData(LS_KEYS.USER).isTwoFactorEnabled ?? false;
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
setIsTwoFactorEnabled(isTwoFactorEnabled);
}, []);
useEffect(() => {
- if (!open) {
- return;
- }
- const main = async () => {
+ if (!open) return;
+ void (async () => {
const isEnabled = await get2FAStatus();
setIsTwoFactorEnabled(isEnabled);
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
await setLSUser({
...getData(LS_KEYS.USER),
isTwoFactorEnabled: isEnabled,
});
- };
- main();
+ })();
}, [open]);
const handleRootClose = () => {
@@ -78,7 +79,7 @@ const SetupDrawerContents: React.FC<ContentsProps> = ({ onRootClose }) => {
const configure = () => {
onRootClose();
- router.push(PAGES.TWO_FACTOR_SETUP);
+ void router.push(PAGES.TWO_FACTOR_SETUP);
};
return (
@@ -118,6 +119,7 @@ const ManageDrawerContents: React.FC<ContentsProps> = ({ onRootClose }) => {
const disable = async () => {
await disable2FA();
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
await setLSUser({
...getData(LS_KEYS.USER),
isTwoFactorEnabled: false,
@@ -136,9 +138,9 @@ const ManageDrawerContents: React.FC<ContentsProps> = ({ onRootClose }) => {
},
});
- const reconfigure = () => {
+ const reconfigure = async () => {
onRootClose();
- router.push(PAGES.TWO_FACTOR_SETUP);
+ await router.push(PAGES.TWO_FACTOR_SETUP);
};
return (