Just use _canceled

Instead of both that and _unmounted
This commit is contained in:
David Baker 2016-08-11 10:06:22 +01:00
parent cab95f43ff
commit a58a6275e5

View file

@ -43,7 +43,7 @@ export default class MultiInviteDialog extends React.Component {
}
componentWillUnmount() {
this._unmounted = true;
this._canceled = true;
}
_onCancel() {
@ -90,7 +90,7 @@ export default class MultiInviteDialog extends React.Component {
}
inviteToRoom(this.props.roomId, input).then(() => {
if (this._unmounted) { return; }
if (this._canceled) { return; }
this.setState((s) => {
s.completionStates[nextIndex] = 'invited'
@ -98,7 +98,7 @@ export default class MultiInviteDialog extends React.Component {
});
this._inviteMore(nextIndex + 1);
}, (err) => {
if (this._unmounted) { return; }
if (this._canceled) { return; }
let errorText;
let fatal = false;