Remove redundant code
This commit is contained in:
parent
d714291aa1
commit
59c54d3756
1 changed files with 5 additions and 9 deletions
|
@ -191,14 +191,8 @@ module.exports = React.createClass({
|
||||||
newState.room = MatrixClientPeg.get().getRoom(newState.roomId);
|
newState.room = MatrixClientPeg.get().getRoom(newState.roomId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.state.roomId !== newState.roomId) {
|
if (this.state.roomId === null && newState.roomId !== null) {
|
||||||
// Store the scroll state for the previous room so that we can return to this
|
// Get the scroll state for the new room
|
||||||
// position when viewing this room in future.
|
|
||||||
if (this.state.roomId) {
|
|
||||||
RoomScrollStateStore.setScrollState(this.state.roomId, this._getScrollState());
|
|
||||||
}
|
|
||||||
|
|
||||||
// ...and get the scroll state for the new room
|
|
||||||
|
|
||||||
// If an event ID wasn't specified, default to the one saved for this room
|
// If an event ID wasn't specified, default to the one saved for this room
|
||||||
// in the scroll state store. Assume initialEventPixelOffset should be set.
|
// in the scroll state store. Assume initialEventPixelOffset should be set.
|
||||||
|
@ -354,7 +348,9 @@ module.exports = React.createClass({
|
||||||
this.unmounted = true;
|
this.unmounted = true;
|
||||||
|
|
||||||
// update the scroll map before we get unmounted
|
// update the scroll map before we get unmounted
|
||||||
RoomScrollStateStore.setScrollState(this.state.roomId, this._getScrollState());
|
if (this.state.roomId) {
|
||||||
|
RoomScrollStateStore.setScrollState(this.state.roomId, this._getScrollState());
|
||||||
|
}
|
||||||
|
|
||||||
if (this.refs.roomView) {
|
if (this.refs.roomView) {
|
||||||
// disconnect the D&D event listeners from the room view. This
|
// disconnect the D&D event listeners from the room view. This
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue