Fix showing wrong comment after user submitted a comment in ViewPostDetailFragment.

This commit is contained in:
Alex Ning 2021-06-25 12:46:14 +08:00
parent 2236305e19
commit 9819059e29
2 changed files with 2 additions and 3 deletions

View File

@ -845,9 +845,9 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
mVisibleComments.add(0, comment); mVisibleComments.add(0, comment);
if (isInitiallyLoading) { if (isInitiallyLoading) {
notifyItemInserted(2);
} else {
notifyItemInserted(1); notifyItemInserted(1);
} else {
notifyItemInserted(0);
} }
} }

View File

@ -570,7 +570,6 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
mRecyclerView.setAdapter(mConcatAdapter); mRecyclerView.setAdapter(mConcatAdapter);
} }
if (comments == null) { if (comments == null) {
fetchCommentsRespectRecommendedSort(false); fetchCommentsRespectRecommendedSort(false);
} else { } else {