From 51bc1873747adcadb873748d28781109ae97187c Mon Sep 17 00:00:00 2001 From: Froidefond Julien Date: Tue, 24 Feb 2026 17:12:46 +0100 Subject: [PATCH] fix: convert Map to Record for server-client boundary, remove dead currentUser prop - WeatherBoard: change previousEntries type from Map to Record and update lookup from .get() to bracket notation - page.tsx: wrap previousEntries with Object.fromEntries() before passing as prop, remove unused currentUser prop - WeatherCard: remove spurious eslint-disable-next-line comment for non-existent rule react-hooks/set-state-in-effect Co-Authored-By: Claude Sonnet 4.6 --- src/app/weather/[id]/page.tsx | 7 +------ src/components/weather/WeatherBoard.tsx | 9 ++------- src/components/weather/WeatherCard.tsx | 1 - 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/app/weather/[id]/page.tsx b/src/app/weather/[id]/page.tsx index 7af13bb..a28f328 100644 --- a/src/app/weather/[id]/page.tsx +++ b/src/app/weather/[id]/page.tsx @@ -93,11 +93,6 @@ export default async function WeatherSessionPage({ params }: WeatherSessionPageP diff --git a/src/components/weather/WeatherBoard.tsx b/src/components/weather/WeatherBoard.tsx index 9cae558..7a9710a 100644 --- a/src/components/weather/WeatherBoard.tsx +++ b/src/components/weather/WeatherBoard.tsx @@ -38,11 +38,6 @@ type PreviousEntry = { interface WeatherBoardProps { sessionId: string; currentUserId: string; - currentUser: { - id: string; - name: string | null; - email: string; - }; entries: WeatherEntry[]; shares: Share[]; owner: { @@ -51,7 +46,7 @@ interface WeatherBoardProps { email: string; }; canEdit: boolean; - previousEntries: Map; + previousEntries: Record; } export function WeatherBoard({ @@ -146,7 +141,7 @@ export function WeatherBoard({ currentUserId={currentUserId} entry={entry} canEdit={canEdit} - previousEntry={previousEntries.get(entry.userId) ?? null} + previousEntry={previousEntries[entry.userId] ?? null} /> ))} diff --git a/src/components/weather/WeatherCard.tsx b/src/components/weather/WeatherCard.tsx index 630fd53..2b30012 100644 --- a/src/components/weather/WeatherCard.tsx +++ b/src/components/weather/WeatherCard.tsx @@ -69,7 +69,6 @@ export function WeatherCard({ sessionId, currentUserId, entry, canEdit, previous // Sync local state with props when they change (e.g., from SSE refresh) useEffect(() => { - // eslint-disable-next-line react-hooks/set-state-in-effect setNotes(entry.notes || ''); setPerformanceEmoji(entry.performanceEmoji || null); setMoralEmoji(entry.moralEmoji || null);