Invite Dialog don't show warning modals after unmount, it is jarring

pull/21833/head
Michael Telatynski 2021-05-26 16:38:02 +01:00
parent 97c6ee39d0
commit 3f10279e15
1 changed files with 6 additions and 0 deletions

View File

@ -351,6 +351,7 @@ export default class InviteDialog extends React.PureComponent<IInviteDialogProps
_debounceTimer: NodeJS.Timeout = null; // actually number because we're in the browser _debounceTimer: NodeJS.Timeout = null; // actually number because we're in the browser
_editorRef: any = null; _editorRef: any = null;
private unmounted = false;
constructor(props) { constructor(props) {
super(props); super(props);
@ -400,6 +401,10 @@ export default class InviteDialog extends React.PureComponent<IInviteDialogProps
} }
} }
componentWillUnmount() {
this.unmounted = true;
}
private onConsultFirstChange = (ev) => { private onConsultFirstChange = (ev) => {
this.setState({consultFirst: ev.target.checked}); this.setState({consultFirst: ev.target.checked});
} }
@ -1027,6 +1032,7 @@ export default class InviteDialog extends React.PureComponent<IInviteDialogProps
failed.push(address); failed.push(address);
} }
} }
if (this.unmounted) return;
if (failed.length > 0) { if (failed.length > 0) {
const QuestionDialog = sdk.getComponent('dialogs.QuestionDialog'); const QuestionDialog = sdk.getComponent('dialogs.QuestionDialog');