Recover from no result after switching sort mode

Resolves #563
This commit is contained in:
scria1000 2021-12-01 21:35:41 +03:00
parent e2964893da
commit 68db5a670d

View File

@ -1260,7 +1260,8 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
mFetchPostInfoLinearLayout.setOnClickListener(view -> refresh());
showErrorView(R.string.load_posts_error);
}
if (appendLoadState instanceof LoadState.NotLoading) {
if (!(refreshLoadState instanceof LoadState.Loading) // #563
&& appendLoadState instanceof LoadState.NotLoading) {
if (appendLoadState.getEndOfPaginationReached() && mAdapter.getItemCount() < 1) {
noPostFound();
}