Merge pull request #1354 from matrix-org/dbkr/fix_super_slow_room_change
Fix room change sometimes being very slowpull/21833/head
commit
b42dfc51e1
|
@ -344,9 +344,16 @@ var TimelinePanel = React.createClass({
|
||||||
newState[canPaginateOtherWayKey] = true;
|
newState[canPaginateOtherWayKey] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setState(newState);
|
// Don't resolve until the setState has completed: we need to let
|
||||||
|
// the component update before we consider the pagination completed,
|
||||||
return r;
|
// otherwise we'll end up paginating in all the history the js-sdk
|
||||||
|
// has in memory because we never gave the component a chance to scroll
|
||||||
|
// itself into the right place
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
this.setState(newState, () => {
|
||||||
|
resolve(r);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue