Add unmounted guard
parent
5efd5bf927
commit
026582bcf7
|
@ -64,6 +64,7 @@ const Pill = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
componentWillMount() {
|
componentWillMount() {
|
||||||
|
this._unmounted = false;
|
||||||
let regex = REGEX_MATRIXTO;
|
let regex = REGEX_MATRIXTO;
|
||||||
if (this.props.inMessage) {
|
if (this.props.inMessage) {
|
||||||
regex = REGEX_LOCAL_MATRIXTO;
|
regex = REGEX_LOCAL_MATRIXTO;
|
||||||
|
@ -111,8 +112,15 @@ const Pill = React.createClass({
|
||||||
this.setState({resourceId, pillType, member, room});
|
this.setState({resourceId, pillType, member, room});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
this._unmounted = true;
|
||||||
|
},
|
||||||
|
|
||||||
doProfileLookup: function(userId, member) {
|
doProfileLookup: function(userId, member) {
|
||||||
MatrixClientPeg.get().getProfileInfo(userId).then((resp) => {
|
MatrixClientPeg.get().getProfileInfo(userId).then((resp) => {
|
||||||
|
if (this._unmounted) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
member.name = resp.displayname;
|
member.name = resp.displayname;
|
||||||
member.rawDisplayName = resp.displayname;
|
member.rawDisplayName = resp.displayname;
|
||||||
member.events.member = {
|
member.events.member = {
|
||||||
|
|
Loading…
Reference in New Issue