fix: Comprehensive authentication and UI fixes
Authentication & Token Management: - Add deviceId to token refresh flow (backend requires both refreshToken and deviceId) - Fix React Strict Mode token clearing race condition with retry logic - Improve AuthContext to handle all token state combinations properly - Store deviceId in localStorage alongside tokens UI/UX Improvements: - Remove deprecated legacyBehavior from Next.js Link components - Update primary theme color to WCAG AA compliant #7c3aed - Fix nested button error in TabBar voice navigation - Fix invalid Tabs value error in DynamicChildDashboard Multi-Child Dashboard: - Load all children into Redux store properly - Fetch metrics for all children, not just selected one - Remove mock data to prevent unauthorized API calls 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -91,45 +91,18 @@ interface ChildrenState {
|
||||
lastSyncTime: string | null;
|
||||
}
|
||||
|
||||
// Mock children for development (matches real data from andrei@cloudz.ro)
|
||||
const MOCK_CHILDREN: Child[] = process.env.NODE_ENV === 'development' ? [
|
||||
{
|
||||
id: 'child_alice123',
|
||||
familyId: 'fam_test123',
|
||||
name: 'Alice',
|
||||
birthDate: '2023-03-15',
|
||||
gender: 'female',
|
||||
displayColor: '#FF6B9D',
|
||||
sortOrder: 1,
|
||||
createdAt: new Date().toISOString(),
|
||||
},
|
||||
{
|
||||
id: 'child_bob456',
|
||||
familyId: 'fam_test123',
|
||||
name: 'Bob',
|
||||
birthDate: '2024-06-20',
|
||||
gender: 'male',
|
||||
displayColor: '#4A90E2',
|
||||
sortOrder: 2,
|
||||
createdAt: new Date().toISOString(),
|
||||
},
|
||||
] : [];
|
||||
|
||||
const childrenSlice = createSlice({
|
||||
name: 'children',
|
||||
initialState: childrenAdapter.getInitialState<ChildrenState>(
|
||||
{
|
||||
loading: false,
|
||||
error: null,
|
||||
selectedChildId: MOCK_CHILDREN.length > 0 ? MOCK_CHILDREN[0].id : null,
|
||||
selectedChildIds: MOCK_CHILDREN.length > 0 ? [MOCK_CHILDREN[0].id] : [],
|
||||
defaultChildId: MOCK_CHILDREN.length > 0 ? MOCK_CHILDREN[0].id : null,
|
||||
viewMode: 'auto',
|
||||
lastSelectedPerScreen: {},
|
||||
lastSyncTime: null,
|
||||
},
|
||||
MOCK_CHILDREN
|
||||
),
|
||||
initialState: childrenAdapter.getInitialState<ChildrenState>({
|
||||
loading: false,
|
||||
error: null,
|
||||
selectedChildId: null,
|
||||
selectedChildIds: [],
|
||||
defaultChildId: null,
|
||||
viewMode: 'auto',
|
||||
lastSelectedPerScreen: {},
|
||||
lastSyncTime: null,
|
||||
}),
|
||||
reducers: {
|
||||
// Optimistic operations
|
||||
optimisticCreate: (state, action: PayloadAction<Child>) => {
|
||||
|
||||
Reference in New Issue
Block a user