Set lastViewed on initial load

multisite
Floens 10 years ago
parent 64a77b601b
commit b9336356d3
  1. 9
      Clover/app/src/main/java/org/floens/chan/core/presenter/ThreadPresenter.java

@ -229,17 +229,20 @@ public class ThreadPresenter implements ChanLoader.ChanLoaderCallback, PostAdapt
if (loadable.isThreadMode()) { if (loadable.isThreadMode()) {
int postsSize = result.posts.size(); int postsSize = result.posts.size();
if (loadable.lastViewed < 0) {
loadable.lastViewed = result.posts.get(result.posts.size() - 1).no;
}
if (notificationPostCount < 0) { if (notificationPostCount < 0) {
notificationPostCount = postsSize; notificationPostCount = postsSize;
} else { } else if (postsSize > notificationPostCount) {
if (postsSize > notificationPostCount) {
int more = postsSize - notificationPostCount; int more = postsSize - notificationPostCount;
notificationPostCount = postsSize; notificationPostCount = postsSize;
threadPresenterCallback.showNewPostsNotification(true, more); threadPresenterCallback.showNewPostsNotification(true, more);
} }
} }
}
chanLoader.setAutoLoadMore(isWatching()); chanLoader.setAutoLoadMore(isWatching());
showPosts(); showPosts();

Loading…
Cancel
Save