make broken connections more obvious by removing controls

This commit is contained in:
Vinzenz Schroeter 2024-05-02 19:07:46 +02:00 committed by RobbersDaughter
parent d9e9c28976
commit cd12ab7bde
3 changed files with 7 additions and 1 deletions

View file

@ -58,6 +58,9 @@ export default function Controls({player}: { player: string }) {
};
}, [readyState]);
if (readyState != ReadyState.OPEN)
return <></>;
return <div className="Controls flex-row">
<div className="flex-column Controls-Container">
<h3>Move</h3>

View file

@ -36,6 +36,9 @@ export default function MapChooser() {
postMap.mutate(chosenMap);
};
if (query.isError)
return <></>;
const disabled = !query.isSuccess || postMap.isPending;
return <select className="MapChooser-DropDown" onChange={onChange} disabled={disabled}>

View file

@ -57,7 +57,7 @@ export default function PlayerInfo({player}: { player: string }) {
sendMessage('');
}, [readyState, shouldSendMessage]);
if (!lastJsonMessage)
if (!lastJsonMessage || readyState !== ReadyState.OPEN)
return <></>;
return <Column className="PlayerInfo">