Skip to content

armgit / ente

Public Imported from GitHub
0

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

Rearrange

Manav Rathiad406a0f0b27
diff --git a/web/apps/photos/src/components/DeleteAccountModal.tsx b/web/apps/photos/src/components/DeleteAccountModal.tsx
index 64daa48889..c470d92220 100644
--- a/web/apps/photos/src/components/DeleteAccountModal.tsx
+++ b/web/apps/photos/src/components/DeleteAccountModal.tsx
@@ -1,7 +1,7 @@
+import { initiateEmail } from "@/new/photos/utils/web";
import log from "@/next/log";
import DialogBoxV2 from "@ente/shared/components/DialogBoxV2";
import EnteButton from "@ente/shared/components/EnteButton";
-import { DELETE_ACCOUNT_EMAIL } from "@ente/shared/constants/urls";
import { Button, Link, Stack } from "@mui/material";
import { Formik, type FormikHelpers } from "formik";
import { t } from "i18next";
@@ -10,7 +10,7 @@ import { GalleryContext } from "pages/gallery";
import { useContext, useEffect, useRef, useState } from "react";
import { Trans } from "react-i18next";
import { deleteAccount, getAccountDeleteChallenge } from "services/userService";
-import { initiateEmail, preloadImage } from "utils/common";
+import { preloadImage } from "utils/common";
import { decryptDeleteAccountChallenge } from "utils/crypto";
import * as Yup from "yup";
import { CheckboxInput } from "./CheckboxInput";
@@ -113,22 +113,20 @@ const DeleteAccountModal = ({ open, onClose }: Iprops) => {
};
const askToMailForDeletion = () => {
+ const emailID = "[email protected]";
+
setDialogBoxAttributesV2({
title: t("delete_account"),
content: (
<Trans
i18nKey="delete_account_message"
- components={{
- a: <Link href={`mailto:${DELETE_ACCOUNT_EMAIL}`} />,
- }}
- values={{ emailID: DELETE_ACCOUNT_EMAIL }}
+ components={{ a: <Link href={`mailto:${emailID}`} /> }}
+ values={{ emailID }}
/>
),
proceed: {
text: t("DELETE"),
- action: () => {
- initiateEmail("[email protected]");
- },
+ action: () => initiateEmail(emailID),
variant: "critical",
},
close: { text: t("CANCEL") },
diff --git a/web/apps/photos/src/utils/common/index.ts b/web/apps/photos/src/utils/common/index.ts
index 059dfed2be..9de9f54c41 100644
--- a/web/apps/photos/src/utils/common/index.ts
+++ b/web/apps/photos/src/utils/common/index.ts
@@ -1,10 +1,3 @@
-export function initiateEmail(email: string) {
- const a = document.createElement("a");
- a.href = "mailto:" + email;
- a.rel = "noreferrer noopener";
- a.click();
-}
-
export const preloadImage = (imgBasePath: string) => {
const srcSet = [];
for (let i = 1; i <= 3; i++) {
diff --git a/web/packages/new/photos/hello.ts b/web/packages/new/photos/hello.ts
deleted file mode 100644
index 7a6cfff7a6..0000000000
--- a/web/packages/new/photos/hello.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-/** Dummy function to get the package to behave. */
-export const hello = (ms: number) => ms;
diff --git a/web/packages/new/photos/utils/web.ts b/web/packages/new/photos/utils/web.ts
new file mode 100644
index 0000000000..18f72bd61e
--- /dev/null
+++ b/web/packages/new/photos/utils/web.ts
@@ -0,0 +1,10 @@
+/**
+ * Open the system configured email client, initiating a new email to the given
+ * {@link email} address.
+ */
+export const initiateEmail = (email: string) => {
+ const a = document.createElement("a");
+ a.href = "mailto:" + email;
+ a.rel = "noreferrer noopener";
+ a.click();
+};
diff --git a/web/packages/new/tsconfig.json b/web/packages/new/tsconfig.json
index 954e092ba3..1e10008cd4 100644
--- a/web/packages/new/tsconfig.json
+++ b/web/packages/new/tsconfig.json
@@ -1,7 +1,7 @@
{
"extends": "@/build-config/tsconfig-typecheck.json",
"compilerOptions": {
- /* MUI doesn't play great with exactOptionalPropertyTypes currently. */
+ /* MUI doesn't work with exactOptionalPropertyTypes yet. */
"exactOptionalPropertyTypes": false
},
"include": [
diff --git a/web/packages/shared/constants/urls.ts b/web/packages/shared/constants/urls.ts
index 89d5faa169..fcedf3841b 100644
--- a/web/packages/shared/constants/urls.ts
+++ b/web/packages/shared/constants/urls.ts
@@ -1,5 +1,3 @@
export const ENTE_WEBSITE_LINK = "https://ente.io";
export const SUPPORT_EMAIL = "[email protected]";
-
-export const DELETE_ACCOUNT_EMAIL = "[email protected]";