Fix joining
This commit is contained in:
parent
d10b1457ba
commit
cc4fa6140c
|
@ -25,6 +25,9 @@ module.exports = {
|
||||||
},*/
|
},*/
|
||||||
|
|
||||||
onRoomTimeline: function(ev, room, toStartOfTimeline) {
|
onRoomTimeline: function(ev, room, toStartOfTimeline) {
|
||||||
|
// no point handling anything while we're waiting for the join to finish:
|
||||||
|
// we'll only be showing a spinner.
|
||||||
|
if (this.state.joining) return;
|
||||||
if (room.roomId != this.props.roomId) return;
|
if (room.roomId != this.props.roomId) return;
|
||||||
|
|
||||||
if (this.refs.messageList) {
|
if (this.refs.messageList) {
|
||||||
|
@ -51,13 +54,15 @@ module.exports = {
|
||||||
},
|
},
|
||||||
|
|
||||||
onJoinButtonClicked: function(ev) {
|
onJoinButtonClicked: function(ev) {
|
||||||
|
var that = this;
|
||||||
MatrixClientPeg.get().joinRoom(this.props.roomId).then(function() {
|
MatrixClientPeg.get().joinRoom(this.props.roomId).then(function() {
|
||||||
this.setState({
|
that.setState({
|
||||||
joining: undefined
|
joining: false,
|
||||||
|
room: MatrixClientPeg.get().getRoom(that.props.roomId)
|
||||||
});
|
});
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
this.setState({
|
that.setState({
|
||||||
joining: undefined,
|
joining: false,
|
||||||
joinError: error
|
joinError: error
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue