You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-16 22:01:54 +03:00
Fix 'Failed to load timeline position' regression
Ignore the update that comes in from the RoomViewStore when the current room changes or we save our scoll state against the new room rather than the old one. Fixes https://github.com/vector-im/riot-web/issues/5010
This commit is contained in:
@ -157,6 +157,19 @@ module.exports = React.createClass({
|
||||
if (this.unmounted) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!initial && this.state.roomId !== RoomViewStore.getRoomId()) {
|
||||
// RoomView explicitly does not support changing what room
|
||||
// is being viewed: instead it should just be re-mounted when
|
||||
// switching rooms. Therefore, if the room ID changes, we
|
||||
// ignore this. We either need to do this or add code to handle
|
||||
// saving the scroll position (otherwise we end up saving the
|
||||
// scroll position against the wrong room). Given that doing the
|
||||
// setState here would cause a bunch of unnecessary work, we
|
||||
// just ignore the change.
|
||||
return;
|
||||
}
|
||||
|
||||
const newState = {
|
||||
roomId: RoomViewStore.getRoomId(),
|
||||
roomAlias: RoomViewStore.getRoomAlias(),
|
||||
|
Reference in New Issue
Block a user