Fix peeking keeping two timeline update mechanisms in play

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2020-03-31 10:37:56 +01:00
parent 4e8cec354d
commit a2a9dc6cd0
2 changed files with 12 additions and 5 deletions

View file

@ -236,6 +236,11 @@ export default createReactClass({
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
console.log(
'RVS update:',

View file

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