Merge pull request #565 from scria1000/search-filter-fix-1

Recover from no result after switching sort mode
This commit is contained in:
Docile-Alligator 2021-12-02 20:32:18 +08:00 committed by GitHub
commit 2381826165
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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();
}