Commit e9712d19 authored by Chunchi Che's avatar Chunchi Che

fix

parent ede3c8e1
......@@ -166,11 +166,13 @@ export default function WaitRoom() {
if (pos > 1) {
console.log("Currently only supported 2v2 mode.");
} else {
const player = {
name,
state: NO_READY_STATE
const updatePlayer = (player: Player) => {
player.name = name;
return player;
};
pos == 0 ? setPlayer0(player) : setPlayer1(player);
pos == 0 ? setPlayer0(updatePlayer) : setPlayer1(updatePlayer);
forceUpdate();
}
break;
......@@ -203,6 +205,7 @@ export default function WaitRoom() {
break;
}
}
forceUpdate();
}
break;
......@@ -261,11 +264,13 @@ export default function WaitRoom() {
<p>
<button
disabled={
!(
isHost &&
player0.state != undefined &&
player0.state === READY_STATE &&
player1.state != undefined &&
player1.state === READY_STATE
)
}
onClick={handleChoseStart}
>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment