DeleteAccount: Do not show explanation related to federation if not federating

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
environments/review-delete-acc-akv00k/deployments/38
marcin mikołajczak 2 years ago
parent dfcde45735
commit 76cf741bf8

@ -4,12 +4,13 @@ import { defineMessages, useIntl } from 'react-intl';
import { deleteAccount } from 'soapbox/actions/security';
import snackbar from 'soapbox/actions/snackbar';
import { Button, Card, CardBody, CardHeader, CardTitle, Form, FormActions, FormGroup, Input } from 'soapbox/components/ui';
import { useAppDispatch } from 'soapbox/hooks';
import { useAppDispatch, useFeatures } from 'soapbox/hooks';
const messages = defineMessages({
passwordFieldLabel: { id: 'security.fields.password.label', defaultMessage: 'Password' },
deleteHeader: { id: 'security.headers.delete', defaultMessage: 'Delete Account' },
deleteText: { id: 'security.text.delete', defaultMessage: 'To delete your account, enter your password then click Delete Account. This is a permanent action that cannot be undone. Your account will be destroyed from this server, and a deletion request will be sent to other servers. It\'s not guaranteed that all servers will purge your account.' },
localDeleteText: { id: 'security.text.delete.local', defaultMessage: 'To delete your account, enter your password then click Delete Account. This is a permanent action that cannot be undone.' },
deleteSubmit: { id: 'security.submit.delete', defaultMessage: 'Delete Account' },
deleteAccountSuccess: { id: 'security.delete_account.success', defaultMessage: 'Account successfully deleted.' },
deleteAccountFail: { id: 'security.delete_account.fail', defaultMessage: 'Account deletion failed.' },
@ -18,6 +19,7 @@ const messages = defineMessages({
const DeleteAccount = () => {
const intl = useIntl();
const dispatch = useAppDispatch();
const features = useFeatures();
const [password, setPassword] = React.useState('');
const [isLoading, setLoading] = React.useState(false);
@ -49,7 +51,7 @@ const DeleteAccount = () => {
<CardBody>
<p className='text-gray-400 mb-4'>
{intl.formatMessage(messages.deleteText)}
{intl.formatMessage(features.federating ? messages.deleteText : messages.localDeleteText)}
</p>
<Form onSubmit={handleSubmit}>

Loading…
Cancel
Save