Add confirmation choice for passing
This commit is contained in:
parent
e0fe22e9ce
commit
6c7a90c421
1 changed files with 7 additions and 5 deletions
|
@ -389,6 +389,7 @@ export function Game(props: {
|
||||||
trayDispatch({action: TileDispatchActionType.RETURN});
|
trayDispatch({action: TileDispatchActionType.RETURN});
|
||||||
}}>Return Tiles</button>
|
}}>Return Tiles</button>
|
||||||
<button className="pass" onClick={() => {
|
<button className="pass" onClick={() => {
|
||||||
|
if (window.confirm("Are you sure you want to pass?")) {
|
||||||
const result = props.wasm.skip_turn() as MyResult<string>;
|
const result = props.wasm.skip_turn() as MyResult<string>;
|
||||||
handlePlayerAction({type: "Pass"}, props.settings.playerName);
|
handlePlayerAction({type: "Pass"}, props.settings.playerName);
|
||||||
setTurnCount(turnCount + 1);
|
setTurnCount(turnCount + 1);
|
||||||
|
@ -396,6 +397,7 @@ export function Game(props: {
|
||||||
if (result.game_state.type === "Ended") {
|
if (result.game_state.type === "Ended") {
|
||||||
endGame(result.game_state);
|
endGame(result.game_state);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}}>Pass</button>
|
}}>Pass</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue