From 333604afcc80a2da9a2d4cc60c17b584626c2866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20S=C3=B6derberg?= Date: Sun, 24 May 2026 16:26:39 +0200 Subject: [PATCH] Fixed linting errors --- frontend/src/pages/Courts.tsx | 8 +++++++- frontend/src/pages/Dashboard.tsx | 6 ++++-- frontend/src/pages/Tournament.tsx | 5 ++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/Courts.tsx b/frontend/src/pages/Courts.tsx index 114cdd7..250da39 100644 --- a/frontend/src/pages/Courts.tsx +++ b/frontend/src/pages/Courts.tsx @@ -33,6 +33,12 @@ interface GlobalCourt { name: string; } +interface OutletContext { + setNavTitle: (t: string) => void; + setNavSubtitle: (s: string) => void; + role: string | null; +} + const CourtColumn = ({ courtId, onDelete, role }: { courtId: number, onDelete: (id: number) => void, role: string | null }) => { const [data, setData] = useState(null); const [currentTime, setCurrentTime] = useState(''); @@ -194,7 +200,7 @@ const CourtColumn = ({ courtId, onDelete, role }: { courtId: number, onDelete: ( }; export default function Courts() { - const { setNavTitle, setNavSubtitle, role } = useOutletContext(); + const { setNavTitle, setNavSubtitle, role } = useOutletContext(); const [courts, setCourts] = useState([]); const [loading, setLoading] = useState(true); const [newCourtName, setNewCourtName] = useState(''); diff --git a/frontend/src/pages/Dashboard.tsx b/frontend/src/pages/Dashboard.tsx index 22c99ff..1d350a6 100644 --- a/frontend/src/pages/Dashboard.tsx +++ b/frontend/src/pages/Dashboard.tsx @@ -47,10 +47,12 @@ export default function Dashboard() { useEffect(() => { setNavTitle('Dashboard'); setNavSubtitle(''); - void loadDashboard(); - localStorage.removeItem('volley_view'); + (async () => { + await loadDashboard(); + })(); + let ws: WebSocket; const connect = () => { try { diff --git a/frontend/src/pages/Tournament.tsx b/frontend/src/pages/Tournament.tsx index 353286f..6e9452c 100644 --- a/frontend/src/pages/Tournament.tsx +++ b/frontend/src/pages/Tournament.tsx @@ -149,7 +149,10 @@ export default function Tournament() { }, [id, setNavTitle, setNavSubtitle]); useEffect(() => { - void fetchData(); + (async () => { + await fetchData(); + })(); + if (wsRef.current) return; const connect = () => {