diff --git a/public/locales/en/user.json b/public/locales/en/user.json
index b21e24645..5db8b25b5 100644
--- a/public/locales/en/user.json
+++ b/public/locales/en/user.json
@@ -34,6 +34,7 @@
"delete_account": {
"title": "Delete account",
"body": "Permanently delete your account and all of your content.",
+ "error": "An error occurred while deleting your account. Please try again.",
"modal": {
"title": "Enter password to continue",
"placeholder": "Enter your password",
diff --git a/src/components/DeleteAccountModal/DeleteAccountModal.tsx b/src/components/DeleteAccountModal/DeleteAccountModal.tsx
index 6cf666435..de78daf40 100644
--- a/src/components/DeleteAccountModal/DeleteAccountModal.tsx
+++ b/src/components/DeleteAccountModal/DeleteAccountModal.tsx
@@ -11,8 +11,9 @@ import styles from './DeleteAccountModal.module.scss';
import type { DeleteAccountFormData } from '#types/account';
import useForm from '#src/hooks/useForm';
-import { addQueryParam, removeMultipleQueryParams } from '#src/utils/location';
+import { addQueryParam, removeQueryParam } from '#src/utils/location';
import { deleteAccountData, logout } from '#src/stores/AccountController';
+import Alert from '#components/Alert/Alert';
const DeleteAccountModal = () => {
const { t } = useTranslation('user');
@@ -26,7 +27,6 @@ const DeleteAccountModal = () => {
},
onError: () => {
setEnteredPassword('');
- handleCancel();
},
});
@@ -47,9 +47,13 @@ const DeleteAccountModal = () => {
);
const handleCancel = () => {
- navigate(removeMultipleQueryParams(location, ['confirmation', 'u']));
+ navigate(removeQueryParam(location, 'u'));
};
+ if (deleteAccount.isError) {
+ return