People.Client: dialog: ChangeEmailDialog: moved id from state to props

This commit is contained in:
Daniil Senkiv 2019-12-17 08:52:56 +03:00
parent 69896e85fe
commit ad6f1c3e46

View File

@ -27,13 +27,12 @@ class PureChangeEmailDialog extends React.Component {
constructor(props) {
super(props);
const { newEmail, id, language } = props;
const { newEmail, language } = props;
this.state = {
isEmailValid: true,
isRequestRunning: false,
email: newEmail,
id
};
i18n.changeLanguage(language);
@ -45,7 +44,7 @@ class PureChangeEmailDialog extends React.Component {
onSendEmailChangeInstructions = () => {
this.setState({ isRequestRunning: true }, function () {
sendInstructionsToChangeEmail(this.state.id, this.state.email)
sendInstructionsToChangeEmail(this.props.id, this.state.email)
.then((res) => {
toastr.success(res);
})
@ -110,7 +109,6 @@ class PureChangeEmailDialog extends React.Component {
}
}
const ChangeEmailDialogContainer = withTranslation()(PureChangeEmailDialog);
const ChangeEmailDialog = props => (