Merge pull request #1097 from matrix-org/luke/attempt-fix-peeking-regression
Luke/attempt fix peeking regression
This commit is contained in:
commit
8840625045
1 changed files with 19 additions and 4 deletions
|
@ -170,6 +170,21 @@ module.exports = React.createClass({
|
||||||
isInitialEventHighlighted: RoomViewStore.isInitialEventHighlighted(),
|
isInitialEventHighlighted: RoomViewStore.isInitialEventHighlighted(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Temporary logging to diagnose https://github.com/vector-im/riot-web/issues/4307
|
||||||
|
console.log(
|
||||||
|
'RVS update:',
|
||||||
|
newState.roomId,
|
||||||
|
newState.roomAlias,
|
||||||
|
'loading?', newState.roomLoading,
|
||||||
|
'joining?', newState.joining,
|
||||||
|
);
|
||||||
|
|
||||||
|
// NB: This does assume that the roomID will not change for the lifetime of
|
||||||
|
// the RoomView instance
|
||||||
|
if (initial) {
|
||||||
|
newState.room = MatrixClientPeg.get().getRoom(newState.roomId);
|
||||||
|
}
|
||||||
|
|
||||||
// Clear the search results when clicking a search result (which changes the
|
// Clear the search results when clicking a search result (which changes the
|
||||||
// currently scrolled to event, this.state.initialEventId).
|
// currently scrolled to event, this.state.initialEventId).
|
||||||
if (this.state.initialEventId !== newState.initialEventId) {
|
if (this.state.initialEventId !== newState.initialEventId) {
|
||||||
|
@ -185,8 +200,9 @@ module.exports = React.createClass({
|
||||||
this.setState(newState, () => {
|
this.setState(newState, () => {
|
||||||
// At this point, this.state.roomId could be null (e.g. the alias might not
|
// At this point, this.state.roomId could be null (e.g. the alias might not
|
||||||
// have been resolved yet) so anything called here must handle this case.
|
// have been resolved yet) so anything called here must handle this case.
|
||||||
|
if (initial) {
|
||||||
this._onHaveRoom();
|
this._onHaveRoom();
|
||||||
this.onRoom(MatrixClientPeg.get().getRoom(this.state.roomId));
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -205,7 +221,7 @@ module.exports = React.createClass({
|
||||||
// NB. We peek if we are not in the room, although if we try to peek into
|
// NB. We peek if we are not in the room, although if we try to peek into
|
||||||
// a room in which we have a member event (ie. we've left) synapse will just
|
// a room in which we have a member event (ie. we've left) synapse will just
|
||||||
// send us the same data as we get in the sync (ie. the last events we saw).
|
// send us the same data as we get in the sync (ie. the last events we saw).
|
||||||
const room = MatrixClientPeg.get().getRoom(this.state.roomId);
|
const room = this.state.room;
|
||||||
let isUserJoined = null;
|
let isUserJoined = null;
|
||||||
if (room) {
|
if (room) {
|
||||||
isUserJoined = room.hasMembershipState(
|
isUserJoined = room.hasMembershipState(
|
||||||
|
@ -220,7 +236,6 @@ module.exports = React.createClass({
|
||||||
this.onJoinButtonClicked();
|
this.onJoinButtonClicked();
|
||||||
} else if (this.state.roomId) {
|
} else if (this.state.roomId) {
|
||||||
console.log("Attempting to peek into room %s", this.state.roomId);
|
console.log("Attempting to peek into room %s", this.state.roomId);
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
peekLoading: true,
|
peekLoading: true,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue