Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Revert virtualised and auto load of posts #2622

Merged
merged 9 commits into from
Apr 8, 2019
Prev Previous commit
Next Next commit
Revert "MM-14761 Loading channel with lot of unreads should show load…
…er at the top (#2589)"

This reverts commit 3e88c52.
  • Loading branch information
sudheerDev committed Apr 5, 2019
commit 935870de5d77c0fb455fd3eba5b5ed96037faf42
10 changes: 1 addition & 9 deletions components/post_view/post_list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ export default class PostList extends React.PureComponent {
const didUserScrollBackwards = scrollDirection === 'backward' && !scrollUpdateWasRequested;
const isOffsetWithInRange = scrollOffset < HEIGHT_TRIGGER_FOR_MORE_POSTS;
if (isNotLoadingPosts && didUserScrollBackwards && isOffsetWithInRange && !this.state.atEnd) {
this.loadingMorePosts = true;
this.loadMorePosts();
}

Expand Down Expand Up @@ -409,16 +410,7 @@ export default class PostList extends React.PureComponent {
const newMessagesSeparatorIndex = this.state.postListIds.findIndex(
(item) => item.indexOf(PostListRowListIds.START_OF_NEW_MESSAGES) === 0
);

if (newMessagesSeparatorIndex > 0) {
const topMostPostIndex = getClosestValidPostIndex(this.state.postListIds, this.state.postListIds.length);
if (newMessagesSeparatorIndex === topMostPostIndex + 1) {
this.loadMorePosts();
return {
index: this.state.postListIds.length - 1,
position: 'start',
};
}
return {
index: newMessagesSeparatorIndex,
position: 'start',
Expand Down
68 changes: 0 additions & 68 deletions components/post_view/post_list.test.jsx

This file was deleted.