Merge pull request #4310 from matrix-org/t3chguy/fix_peeking

Fix peeking keeping two timeline update mechanisms in play
This commit is contained in:
Michael Telatynski 2020-03-31 14:21:42 +01:00 committed by GitHub
commit 9ed08e76f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 5 deletions

View file

@ -236,6 +236,11 @@ export default createReactClass({
showReadReceipts: SettingsStore.getValue("showReadReceipts", roomId), showReadReceipts: SettingsStore.getValue("showReadReceipts", roomId),
}; };
if (!initial && this.state.shouldPeek && !newState.shouldPeek) {
// Stop peeking because we have joined this room now
this.context.stopPeeking();
}
// Temporary logging to diagnose https://github.com/vector-im/riot-web/issues/4307 // Temporary logging to diagnose https://github.com/vector-im/riot-web/issues/4307
console.log( console.log(
'RVS update:', 'RVS update:',
@ -467,6 +472,10 @@ export default createReactClass({
RoomScrollStateStore.setScrollState(this.state.roomId, this._getScrollState()); RoomScrollStateStore.setScrollState(this.state.roomId, this._getScrollState());
} }
if (this.state.shouldPeek) {
this.context.stopPeeking();
}
// stop tracking room changes to format permalinks // stop tracking room changes to format permalinks
this._stopAllPermalinkCreators(); this._stopAllPermalinkCreators();

View file

@ -123,6 +123,9 @@ class RoomViewStore extends Store {
case 'join_room_error': case 'join_room_error':
this._joinRoomError(payload); this._joinRoomError(payload);
break; break;
case 'join_room_ready':
this._setState({ shouldPeek: false });
break;
case 'on_client_not_viable': case 'on_client_not_viable':
case 'on_logged_out': case 'on_logged_out':
this.reset(); this.reset();
@ -259,11 +262,10 @@ class RoomViewStore extends Store {
MatrixClientPeg.get().joinRoom( MatrixClientPeg.get().joinRoom(
this._state.roomAlias || this._state.roomId, payload.opts, this._state.roomAlias || this._state.roomId, payload.opts,
).then(() => { ).then(() => {
// We don't actually need to do anything here: we do *not* // We do *not* clear the 'joining' flag because the Room object and/or our 'joined' member event may not
// clear the 'joining' flag because the Room object and/or // have come down the sync stream yet, and that's the point at which we'd consider the user joined to the
// our 'joined' member event may not have come down the sync // room.
// stream yet, and that's the point at which we'd consider dis.dispatch({ action: 'join_room_ready' });
// the user joined to the room.
}, (err) => { }, (err) => {
dis.dispatch({ dis.dispatch({
action: 'join_room_error', action: 'join_room_error',