Commit e9712d19 authored by Chunchi Che's avatar Chunchi Che

fix

parent ede3c8e1
...@@ -166,11 +166,13 @@ export default function WaitRoom() { ...@@ -166,11 +166,13 @@ export default function WaitRoom() {
if (pos > 1) { if (pos > 1) {
console.log("Currently only supported 2v2 mode."); console.log("Currently only supported 2v2 mode.");
} else { } else {
const player = { const updatePlayer = (player: Player) => {
name, player.name = name;
state: NO_READY_STATE return player;
}; };
pos == 0 ? setPlayer0(player) : setPlayer1(player);
pos == 0 ? setPlayer0(updatePlayer) : setPlayer1(updatePlayer);
forceUpdate();
} }
break; break;
...@@ -203,6 +205,7 @@ export default function WaitRoom() { ...@@ -203,6 +205,7 @@ export default function WaitRoom() {
break; break;
} }
} }
forceUpdate();
} }
break; break;
...@@ -261,11 +264,13 @@ export default function WaitRoom() { ...@@ -261,11 +264,13 @@ export default function WaitRoom() {
<p> <p>
<button <button
disabled={ disabled={
isHost && !(
player0.state != undefined && isHost &&
player0.state === READY_STATE && player0.state != undefined &&
player1.state != undefined && player0.state === READY_STATE &&
player1.state === READY_STATE player1.state != undefined &&
player1.state === READY_STATE
)
} }
onClick={handleChoseStart} 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