kuuuurt / multiplatform-paging

Kotlin Multiplatform library for Pagination
Apache License 2.0
250 stars 22 forks source link

ios resetPager problem #29

Open befstrat1969 opened 1 year ago

befstrat1969 commented 1 year ago

Hi! Congratulations for the excellent work! I think there is a problem with the resetPager function in the iOS implementation and it seams that it's not working. Looking at the code I see that it sets the _hasNextPage property to false and then calls the loadItems. But as _hasNextPage is false and loadItems checks for _hasNextPage == true it will do nothing. I think _hasNextPage should be reset to true (after all it is true after initialization) but perhaps I am missing something... But as is it doesn't seem to work...

kuuuurt commented 1 year ago

Thanks for the issue and sorry for getting back to this late. I've released v0.5.0 to fix the refresh

befstrat1969 commented 1 year ago

Hi! I am afraid that there is one more fix that has to be done for the resetPager() to work correctly. The new problem is that the _pagingData is not cleared, so after refreshing, the old data are still there. By the way you have already mentioned that _pagingData should be set to null on refresh in another thread [https://github.com/kuuuurt/multiplatform-paging/issues/22], but it is not in the actual code! Thanks!