1
0
mirror of https://gitlab.shinice.net/pixeldroid/PixelDroid synced 2024-12-25 06:23:58 +01:00

Update for paging dependency update

This commit is contained in:
Matthieu 2021-03-14 23:03:36 +01:00
parent 10bf68978d
commit d13b34ed0d

View File

@ -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, Status>): String? =
state.anchorPosition?.run {
state.closestItemToPosition(this)?.id
}
}