mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-07-03 19:12:50 +01:00
Switching Favorites<->Watchlist (props swap in place, no remount) left the page blank with only the tab buttons: the empty-state was written as a side effect inside the queryFn, which React Query skips on cache hits, and a reset effect then cleared it — so on a cache-served switch nothing repopulated it, every list was hidden by hideIfEmpty, and the empty message never rendered. Each list now reports emptiness once its query settles (incl. cache hits) via a new optional onEmptyStateChange callback on InfiniteScrollingCollectionList (mobile + TV), reporting null while loading so a switch never flashes a stale state. The parent derives the aggregate empty-state from that (null = not settled yet, so the message stays hidden during a switch). The reset effect is removed entirely, not kept: React runs child effects before parent effects within a commit, so a parent reset setEmptyState(false) would clobber the children's reported values on the same render. Dropping it and using the per-list callbacks (tri-state null/true/false) is what makes the switch — including a cache-served one — resolve to the correct state. Applies to both mobile and TV Favorites.