diff --git a/app/src/main/java/com/h/pixeldroid/posts/feeds/uncachedFeeds/profile/ProfilePagingSource.kt b/app/src/main/java/com/h/pixeldroid/posts/feeds/uncachedFeeds/profile/ProfilePagingSource.kt index fba34d11..e58301bb 100644 --- a/app/src/main/java/com/h/pixeldroid/posts/feeds/uncachedFeeds/profile/ProfilePagingSource.kt +++ b/app/src/main/java/com/h/pixeldroid/posts/feeds/uncachedFeeds/profile/ProfilePagingSource.kt @@ -1,6 +1,7 @@ package com.h.pixeldroid.posts.feeds.uncachedFeeds.profile import androidx.paging.PagingSource +import androidx.paging.PagingState import com.h.pixeldroid.utils.api.PixelfedAPI import com.h.pixeldroid.utils.api.objects.Status import retrofit2.HttpException @@ -31,4 +32,9 @@ class ProfilePagingSource( LoadResult.Error(exception) } } + + override fun getRefreshKey(state: PagingState): String? = + state.anchorPosition?.run { + state.closestItemToPosition(this)?.id + } } \ No newline at end of file