eternagame / eterna-mobile

Eterna mobile app
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

Hide "Load More" labs button when all labs are loaded #30

Closed tkaragianes closed 2 years ago

tkaragianes commented 2 years ago

"Within the Labs menu - if you reach the end of the Labs and click "Load More Labs", the button stays looking selected/on but never switches off or gives a message saying the end of the list was reached"

tkaragianes commented 2 years ago

Tested it out, and on dev at least, there's 457 labs. Two big problems to implementing this right now:

I think the right move here is to address this with the server refactor, and implement pagination properly in the new backend. Then we can implement a response that tells the frontend "End of data", and can hide "Load More" in response. Pagination will also have the benefit of reducing responses with duplicate data.

luxaritas commented 2 years ago

The server does actually implement pagination. The API supports a skip parameter, and the API call does return a total count (the app just currently throws it away)

tkaragianes commented 2 years ago

Ah. Good to know. My API requests were based on the existing requests in the codebase, and none of them use skip. With total count, I can implement the hide functionality then.

luxaritas commented 2 years ago

Yeah, it was implemented in the old frontend, but got stuck in a WIP PR in the new frontend: https://github.com/eternagame/eternagame.org/pull/215