From 1086dd6345c77c7209d8620729d08bb6a8f49ebc Mon Sep 17 00:00:00 2001 From: Juan Date: Sat, 13 Jun 2026 05:32:32 +0200 Subject: [PATCH] fix: add champion load error state with retry support When the get_champions IPC call fails, the error was silently logged to console. Now it sets championLoadError bool so the UI can detect the failure and re-trigger loading on next effect cycle. --- src/ui-v2/dashboard/DashboardV2.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ui-v2/dashboard/DashboardV2.tsx b/src/ui-v2/dashboard/DashboardV2.tsx index 6a3409d4..f6fbd150 100644 --- a/src/ui-v2/dashboard/DashboardV2.tsx +++ b/src/ui-v2/dashboard/DashboardV2.tsx @@ -212,6 +212,8 @@ export default function DashboardV2() { .catch(() => setProbedNoGame(true)); }, [hasActiveGame, setGameState, setGameActive]); + const [championLoadError, setChampionLoadError] = useState(false); + // Load champions once game state is available useEffect(() => { if (!gameState) return; @@ -221,8 +223,10 @@ export default function DashboardV2() { try { const champions = await invoke("get_champions"); useGameStore.getState().setGameState({ ...gameState, champions } as GameStateData); + setChampionLoadError(false); } catch (err) { console.error("[DashboardV2] Failed to load champions:", err); + setChampionLoadError(true); } }; loadChampions();