Skip to content

Commit

Permalink
Update MoviePagingSource.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
2307vivek authored Nov 26, 2020
1 parent db3c5b0 commit 2cfa44a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ class MoviePagingSource(
LoadResult.Page(
data = movieListResponse.results!!,
prevKey = if (nextPage == 1) null else nextPage - 1 ,
nextKey = if (nextPage <= movieListResponse.totalPages!!)
nextKey = if (nextPage < movieListResponse.totalPages!!)
movieListResponse.page?.plus(1) else null
)
}catch (e: Exception){
LoadResult.Error(e)
}
}
}
}

0 comments on commit 2cfa44a

Please sign in to comment.