|
|
@ -20,7 +20,7 @@ import {
|
|
|
|
deleteAccount,
|
|
|
|
deleteAccount,
|
|
|
|
} from 'soapbox/actions/auth';
|
|
|
|
} from 'soapbox/actions/auth';
|
|
|
|
import { fetchUserMfaSettings } from '../../actions/mfa';
|
|
|
|
import { fetchUserMfaSettings } from '../../actions/mfa';
|
|
|
|
import { showAlert } from 'soapbox/actions/alerts';
|
|
|
|
import snackbar from 'soapbox/actions/snackbar';
|
|
|
|
import { changeSetting, getSettings } from 'soapbox/actions/settings';
|
|
|
|
import { changeSetting, getSettings } from 'soapbox/actions/settings';
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
@ -119,10 +119,10 @@ class ChangeEmailForm extends ImmutablePureComponent {
|
|
|
|
this.setState({ isLoading: true });
|
|
|
|
this.setState({ isLoading: true });
|
|
|
|
return dispatch(changeEmail(email, password)).then(() => {
|
|
|
|
return dispatch(changeEmail(email, password)).then(() => {
|
|
|
|
this.setState({ email: '', password: '' }); // TODO: Maybe redirect user
|
|
|
|
this.setState({ email: '', password: '' }); // TODO: Maybe redirect user
|
|
|
|
dispatch(showAlert('', intl.formatMessage(messages.updateEmailSuccess)));
|
|
|
|
dispatch(snackbar.success(intl.formatMessage(messages.updateEmailSuccess)));
|
|
|
|
}).catch(error => {
|
|
|
|
}).catch(error => {
|
|
|
|
this.setState({ password: '' });
|
|
|
|
this.setState({ password: '' });
|
|
|
|
dispatch(showAlert('', intl.formatMessage(messages.updateEmailFail)));
|
|
|
|
dispatch(snackbar.error(intl.formatMessage(messages.updateEmailFail)));
|
|
|
|
}).then(() => {
|
|
|
|
}).then(() => {
|
|
|
|
this.setState({ isLoading: false });
|
|
|
|
this.setState({ isLoading: false });
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -193,10 +193,10 @@ class ChangePasswordForm extends ImmutablePureComponent {
|
|
|
|
this.setState({ isLoading: true });
|
|
|
|
this.setState({ isLoading: true });
|
|
|
|
return dispatch(changePassword(oldPassword, newPassword, confirmation)).then(() => {
|
|
|
|
return dispatch(changePassword(oldPassword, newPassword, confirmation)).then(() => {
|
|
|
|
this.clearForm(); // TODO: Maybe redirect user
|
|
|
|
this.clearForm(); // TODO: Maybe redirect user
|
|
|
|
dispatch(showAlert('', intl.formatMessage(messages.updatePasswordSuccess)));
|
|
|
|
dispatch(snackbar.success(intl.formatMessage(messages.updatePasswordSuccess)));
|
|
|
|
}).catch(error => {
|
|
|
|
}).catch(error => {
|
|
|
|
this.clearForm();
|
|
|
|
this.clearForm();
|
|
|
|
dispatch(showAlert('', intl.formatMessage(messages.updatePasswordFail)));
|
|
|
|
dispatch(snackbar.error(intl.formatMessage(messages.updatePasswordFail)));
|
|
|
|
}).then(() => {
|
|
|
|
}).then(() => {
|
|
|
|
this.setState({ isLoading: false });
|
|
|
|
this.setState({ isLoading: false });
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -374,10 +374,10 @@ class DeactivateAccount extends ImmutablePureComponent {
|
|
|
|
this.setState({ isLoading: true });
|
|
|
|
this.setState({ isLoading: true });
|
|
|
|
return dispatch(deleteAccount(password)).then(() => {
|
|
|
|
return dispatch(deleteAccount(password)).then(() => {
|
|
|
|
//this.setState({ email: '', password: '' }); // TODO: Maybe redirect user
|
|
|
|
//this.setState({ email: '', password: '' }); // TODO: Maybe redirect user
|
|
|
|
dispatch(showAlert('', intl.formatMessage(messages.deleteAccountSuccess)));
|
|
|
|
dispatch(snackbar.success(intl.formatMessage(messages.deleteAccountSuccess)));
|
|
|
|
}).catch(error => {
|
|
|
|
}).catch(error => {
|
|
|
|
this.setState({ password: '' });
|
|
|
|
this.setState({ password: '' });
|
|
|
|
dispatch(showAlert('', intl.formatMessage(messages.deleteAccountFail)));
|
|
|
|
dispatch(snackbar.error(intl.formatMessage(messages.deleteAccountFail)));
|
|
|
|
}).then(() => {
|
|
|
|
}).then(() => {
|
|
|
|
this.setState({ isLoading: false });
|
|
|
|
this.setState({ isLoading: false });
|
|
|
|
});
|
|
|
|
});
|
|
|
|