mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-26 02:48:23 +01:00
Fix bug when progress indicator is present on the comments page, even after loading all the comments
Signed-off-by: Balazs Toldi <balazs@toldi.eu>
This commit is contained in:
parent
0fa2da6ffa
commit
3b5852d1e4
@ -856,6 +856,16 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
|
||||
}
|
||||
}
|
||||
|
||||
List<Comment> newComments = new ArrayList<>();
|
||||
for (int i = 0; i < comments.size(); i++) {
|
||||
if (loadedComments.contains(comments.get(i).getId())) {
|
||||
continue;
|
||||
}
|
||||
newComments.add(comments.get(i));
|
||||
loadedComments.add(comments.get(i).getId());
|
||||
}
|
||||
comments = (ArrayList<Comment>) newComments;
|
||||
|
||||
int sizeBefore = mVisibleComments.size();
|
||||
mVisibleComments.addAll(comments);
|
||||
for (int i = 0; i < comments.size(); i++) {
|
||||
|
@ -1450,6 +1450,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
||||
@Override
|
||||
public void onFetchCommentSuccess(ArrayList<Comment> expandedComments,
|
||||
Integer parentId, ArrayList<Integer> children) {
|
||||
isFetchingComments = false;
|
||||
ViewPostDetailFragment.this.children = children;
|
||||
pages_loaded++;
|
||||
comments = expandedComments;
|
||||
@ -1508,8 +1509,6 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
||||
if (changeRefreshState) {
|
||||
isRefreshing = false;
|
||||
}
|
||||
|
||||
isFetchingComments = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -1535,8 +1534,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
|
||||
|
||||
isLoadingMoreChildren = true;
|
||||
|
||||
Retrofit retrofit = mAccessToken == null ? mRetrofit.getRetrofit() : mOauthRetrofit;
|
||||
FetchComment.fetchComments(mExecutor, new Handler(), retrofit, mAccessToken,
|
||||
FetchComment.fetchComments(mExecutor, new Handler(), mRetrofit.getRetrofit(), mAccessToken,
|
||||
mPost.getId(), null, sortType, mExpandChildren, pages_loaded + 1, new FetchComment.FetchCommentListener() {
|
||||
@Override
|
||||
public void onFetchCommentSuccess(ArrayList<Comment> expandedComments, Integer parentId, ArrayList<Integer> children) {
|
||||
|
Loading…
Reference in New Issue
Block a user