From cd12ab7bdeb22d4a8e076e8836702b3bc7fc798a Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 2 May 2024 19:07:46 +0200 Subject: [PATCH] make broken connections more obvious by removing controls --- tank-frontend/src/Controls.tsx | 3 +++ tank-frontend/src/MapChooser.tsx | 3 +++ tank-frontend/src/PlayerInfo.tsx | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tank-frontend/src/Controls.tsx b/tank-frontend/src/Controls.tsx index c709bab..d0c175d 100644 --- a/tank-frontend/src/Controls.tsx +++ b/tank-frontend/src/Controls.tsx @@ -58,6 +58,9 @@ export default function Controls({player}: { player: string }) { }; }, [readyState]); + if (readyState != ReadyState.OPEN) + return <>; + return

Move

diff --git a/tank-frontend/src/MapChooser.tsx b/tank-frontend/src/MapChooser.tsx index 00923e2..292802c 100644 --- a/tank-frontend/src/MapChooser.tsx +++ b/tank-frontend/src/MapChooser.tsx @@ -36,6 +36,9 @@ export default function MapChooser() { postMap.mutate(chosenMap); }; + if (query.isError) + return <>; + const disabled = !query.isSuccess || postMap.isPending; return