People.Client: dialogs: ChangeEmailDialog: fixed error "Can't perform a React state update on an unmounted component."
This commit is contained in:
parent
902f6a768e
commit
fca6ed2675
@ -66,8 +66,8 @@ class ChangeEmailDialogComponent extends React.Component {
|
|||||||
})
|
})
|
||||||
.catch((error) => toastr.error(error))
|
.catch((error) => toastr.error(error))
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.props.onClose();
|
|
||||||
this.setState({ isRequestRunning: false });
|
this.setState({ isRequestRunning: false });
|
||||||
|
this.props.onClose();
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
@ -93,7 +93,8 @@ class ChangeEmailDialogComponent extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onKeyPress = event => {
|
onKeyPress = event => {
|
||||||
if (event.key === "Enter") {
|
const { isRequestRunning } = this.state;
|
||||||
|
if (event.key === "Enter" && !isRequestRunning) {
|
||||||
this.onValidateEmail();
|
this.onValidateEmail();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user