remove dot data from game end state
This commit is contained in:
parent
692a8b1400
commit
a8119bb194
3 changed files with 2 additions and 2 deletions
|
@ -42,7 +42,7 @@ const Board = (props) => {
|
||||||
const posY = (i % boardSize) + 1;
|
const posY = (i % boardSize) + 1;
|
||||||
const pointData = board[`${posX}-${posY}`];
|
const pointData = board[`${posX}-${posY}`];
|
||||||
const dotData =
|
const dotData =
|
||||||
meta && meta.turn === 0
|
meta && meta.turn === 0 && !meta.winner
|
||||||
? meta?.territory[`${posX}-${posY}`]
|
? meta?.territory[`${posX}-${posY}`]
|
||||||
: game.turn || meta?.turn;
|
: game.turn || meta?.turn;
|
||||||
boardPoints.push(
|
boardPoints.push(
|
||||||
|
|
|
@ -71,6 +71,7 @@ const Game = (props) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const handlePassClick = (player) => {
|
const handlePassClick = (player) => {
|
||||||
|
if (state?.meta && state?.meta?.winner) return;
|
||||||
if (state?.meta && state?.meta?.turn === 0) {
|
if (state?.meta && state?.meta?.turn === 0) {
|
||||||
const action = {
|
const action = {
|
||||||
type: "SOCKET",
|
type: "SOCKET",
|
||||||
|
|
|
@ -104,7 +104,6 @@ function gameResign(state, action) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function gameEnd(state, action) {
|
function gameEnd(state, action) {
|
||||||
console.log(action);
|
|
||||||
const { winner, score } = action.body.meta;
|
const { winner, score } = action.body.meta;
|
||||||
return { ...state, meta: { ...state.meta, winner, score } };
|
return { ...state, meta: { ...state.meta, winner, score } };
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue