diff --git a/app/src/main/java/org/pixeldroid/app/posts/feeds/uncachedFeeds/accountLists/FollowersPagingSource.kt b/app/src/main/java/org/pixeldroid/app/posts/feeds/uncachedFeeds/accountLists/FollowersPagingSource.kt index 5a5be20c..38af9ef4 100644 --- a/app/src/main/java/org/pixeldroid/app/posts/feeds/uncachedFeeds/accountLists/FollowersPagingSource.kt +++ b/app/src/main/java/org/pixeldroid/app/posts/feeds/uncachedFeeds/accountLists/FollowersPagingSource.kt @@ -56,7 +56,7 @@ class FollowersPagingSource( LoadResult.Page( data = accounts, prevKey = null, - nextKey = if (accounts.isEmpty() or nextPosition.isEmpty()) null else nextPosition + nextKey = if (accounts.isEmpty() || nextPosition.isEmpty() || nextPosition == position) null else nextPosition ) } catch (exception: IOException) { LoadResult.Error(exception) diff --git a/app/src/main/java/org/pixeldroid/app/posts/feeds/uncachedFeeds/hashtags/HashTagPagingSource.kt b/app/src/main/java/org/pixeldroid/app/posts/feeds/uncachedFeeds/hashtags/HashTagPagingSource.kt index 4b30ed57..29903f39 100644 --- a/app/src/main/java/org/pixeldroid/app/posts/feeds/uncachedFeeds/hashtags/HashTagPagingSource.kt +++ b/app/src/main/java/org/pixeldroid/app/posts/feeds/uncachedFeeds/hashtags/HashTagPagingSource.kt @@ -25,10 +25,12 @@ class HashTagPagingSource( max_id = position, ) + val nextKey = response.lastOrNull()?.id + LoadResult.Page( data = response, prevKey = null, - nextKey = response.lastOrNull()?.id + nextKey = if(nextKey == position) null else nextKey ) } catch (exception: HttpException) { LoadResult.Error(exception) diff --git a/app/src/main/java/org/pixeldroid/app/posts/feeds/uncachedFeeds/profile/ProfilePagingSource.kt b/app/src/main/java/org/pixeldroid/app/posts/feeds/uncachedFeeds/profile/ProfilePagingSource.kt index d23930ef..9a98bf44 100644 --- a/app/src/main/java/org/pixeldroid/app/posts/feeds/uncachedFeeds/profile/ProfilePagingSource.kt +++ b/app/src/main/java/org/pixeldroid/app/posts/feeds/uncachedFeeds/profile/ProfilePagingSource.kt @@ -20,10 +20,12 @@ class ProfilePagingSource( limit = params.loadSize ) + val nextKey = posts.lastOrNull()?.id + LoadResult.Page( data = posts, prevKey = null, - nextKey = posts.lastOrNull()?.id + nextKey = if(nextKey == position) null else nextKey ) } catch (exception: HttpException) { LoadResult.Error(exception) diff --git a/app/src/main/java/org/pixeldroid/app/posts/feeds/uncachedFeeds/search/SearchPagingSource.kt b/app/src/main/java/org/pixeldroid/app/posts/feeds/uncachedFeeds/search/SearchPagingSource.kt index b476d7b9..7c4de7ef 100644 --- a/app/src/main/java/org/pixeldroid/app/posts/feeds/uncachedFeeds/search/SearchPagingSource.kt +++ b/app/src/main/java/org/pixeldroid/app/posts/feeds/uncachedFeeds/search/SearchPagingSource.kt @@ -34,10 +34,12 @@ class SearchPagingSource( Results.SearchType.statuses -> response.statuses } as List + val nextKey = if (repos.isEmpty()) null else (position ?: 0) + repos.size + LoadResult.Page( data = repos, prevKey = null, - nextKey = if (repos.isEmpty()) null else (position ?: 0) + repos.size + nextKey = if(nextKey == position) null else nextKey ) } catch (exception: HttpException) { LoadResult.Error(exception)