Commit ecb9e60b authored by Gandalf's avatar Gandalf
Browse files

Fix false 404/empty states when API fails

Previously, profile pages and post lists would show 404 or "Nothing more
to load" when the underlying API calls failed (e.g., 503 errors during
high load). This created a poor user experience since:

- Valid users appeared as "not found" during temporary API outages
- Post lists showed "Nothing more to load" when posts couldn't be fetched
- Clients couldn't retry because they were given false empty states

Changes:

profile-layout.tsx:
- Add isError/isPending states from useQuery for profile and global data
- Show NoDataError component when API fails (allows retry)
- Show loading state (null) while queries are pending
- Only call notFound() when API confirms user doesn't exist
- Show NoDataError for data integrity issues (missing required fields)

list-of-posts.tsx:
- Add isPending state from useInfiniteQuery
- Show NoDataError component when API fails
- Show loading state (null) while query is pending
- Only show "Nothing more to load" when data.pages[0].length > 0

Fixes #789
parent 003444e0
Loading
Loading
Loading
Loading