fix: track detail page liked state race condition (#649)
The liked state wasn't loading on the track detail page because of a
race condition with auth initialization:
1. Page loads, navigation effect runs immediately
2. Effect sets loadedForTrackId = currentId
3. BUT auth.isAuthenticated is still false (async auth not resolved)
4. loadLikedState() is skipped
5. Auth resolves, isAuthenticated becomes true
6. Effect runs again, but loadedForTrackId === currentId, so nothing happens
7. Liked state is never fetched
Fix: Split into two separate effects:
- One for general track data (comments, etc.) - runs immediately
- One for liked state - runs when auth.isAuthenticated becomes true
This ensures the liked heart shows correctly even when auth loads after
the initial page render.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
authored by
zzstoatzz.io
Claude Opus 4.5
and committed by
GitHub
9a9c5123
a2ade221