Unmounted guard
parent
e39979a61f
commit
6b78440466
|
@ -41,6 +41,11 @@ export default WithMatrixClient(React.createClass({
|
||||||
componentWillMount: function() {
|
componentWillMount: function() {
|
||||||
this._addThreepid = null;
|
this._addThreepid = null;
|
||||||
this._addMsisdnInput = null;
|
this._addMsisdnInput = null;
|
||||||
|
this._unmounted = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
componentWillUnmount: function() {
|
||||||
|
this._unmounted = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
_onPhoneCountryChange: function(phoneCountry) {
|
_onPhoneCountryChange: function(phoneCountry) {
|
||||||
|
@ -67,7 +72,6 @@ export default WithMatrixClient(React.createClass({
|
||||||
|
|
||||||
_addMsisdn: function() {
|
_addMsisdn: function() {
|
||||||
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||||
const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
|
|
||||||
|
|
||||||
this._addThreepid = new AddThreepid();
|
this._addThreepid = new AddThreepid();
|
||||||
// we always bind phone numbers when registering, so let's do the
|
// we always bind phone numbers when registering, so let's do the
|
||||||
|
@ -89,6 +93,7 @@ export default WithMatrixClient(React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
_promptForMsisdnVerificationCode:function (msisdn, err) {
|
_promptForMsisdnVerificationCode:function (msisdn, err) {
|
||||||
|
if (this._unmounted) return;
|
||||||
const TextInputDialog = sdk.getComponent("dialogs.TextInputDialog");
|
const TextInputDialog = sdk.getComponent("dialogs.TextInputDialog");
|
||||||
let msgElements = [
|
let msgElements = [
|
||||||
<div>A text message has been sent to +{msisdn}.
|
<div>A text message has been sent to +{msisdn}.
|
||||||
|
|
Loading…
Reference in New Issue