From b07e50d418c5d2e75f0725e5699cf415c689181e Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 22 Jul 2016 17:30:25 +0100 Subject: [PATCH] Fix 'start chat' button on MemberInfo this/self fail & related scoping Fixes https://github.com/vector-im/vector-web/issues/1844 --- src/components/views/rooms/MemberInfo.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/views/rooms/MemberInfo.js b/src/components/views/rooms/MemberInfo.js index c439f8b40c..07a7b9398d 100644 --- a/src/components/views/rooms/MemberInfo.js +++ b/src/components/views/rooms/MemberInfo.js @@ -406,14 +406,14 @@ module.exports = React.createClass({ this.props.onFinished(); } else { - self.setState({ updating: self.state.updating + 1 }); + this.setState({ updating: this.state.updating + 1 }); createRoom({ createOpts: { invite: [this.props.member.userId], }, - }).finally(function() { - self.props.onFinished(); - self.setState({ updating: self.state.updating - 1 }); + }).finally(() => { + this.props.onFinished(); + this.setState({ updating: this.state.updating - 1 }); }).done(); } },