Skip to content

Commit

Permalink
[FIX/#315] hasNext 지역변수화
Browse files Browse the repository at this point in the history
  • Loading branch information
boiledEgg-s committed Jan 1, 2025
1 parent c4f2e14 commit 6d2dbc4
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ class HomePagingSource(
private val dataSource: HomeDataSource
) : PagingSource<Int, Pair<Int, HomeRecommendInternResponseDto.Result>>() {

private var hasNextPage = false

override suspend fun load(params: LoadParams<Int>): LoadResult<Int, Pair<Int, HomeRecommendInternResponseDto.Result>> {
return try {
val nextParamKey = params.key ?: 0

val response = dataSource.getRecommendIntern(sortBy = sortBy, page = nextParamKey)
val totalCount = response.result.totalCount
hasNextPage = response.result.hasNextPage
val hasNextPage = response.result.hasNextPage

LoadResult.Page(
data = response.result.result.map {
Expand Down

0 comments on commit 6d2dbc4

Please sign in to comment.