Commit graph

2 commits

Author SHA1 Message Date
c6657694f7 Fix hydration mismatch causing avatar flash on page load
- Read auth cookies server-side in layout.tsx
- Pass initial auth data as props to AccountStateInitializer
- Initialize Valtio state synchronously before first render
- Fallback to client-side cookie reading only when no server data
- Eliminates anonymous avatar flash during hydration

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-03 16:01:46 -07:00
9b60134933 Fix header not reflecting logged-in state after login
- Add useSnapshot from Valtio to make Header reactive to state changes
- Replace accountState references with accountSnap for reactive updates
- Add missing router import for navigation methods
- Fix router.reload() to router.refresh() for Next.js 13+
- Create AccountStateInitializer component to load auth from cookies
- Add initializer to root layout to ensure state is set on page load

The header now properly updates to show user avatar and authenticated menu when logging in.

🤖 Generated with Claude Code (https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-03 16:01:46 -07:00