DRAW req alerts
This commit is contained in:
parent
16bccde6e1
commit
dc3fd61bd3
@ -13,9 +13,17 @@ export default function GameBoard({ dispatchGuide, username, getGame, onStoneCli
|
||||
const optionalOnStoneClick = (typeof onStoneClick !== 'function') ? null :
|
||||
(cellId) => onStoneClick(game.uuid, cellId);
|
||||
|
||||
const optionalOnStoneMove = (typeof onStoneMove !== 'function' || isPushing || game.status === 'DRAW_REQUEST_WAIT_FOR_YOU' || game.status === 'DRAW_REQUEST_WAIT_FOR_OPPONENT') ? null :
|
||||
const optionalOnStoneMove = (typeof onStoneMove !== 'function' || isPushing) ? null :
|
||||
(move) => {
|
||||
if (move[0] !== move[1] && game.board[move[1]] === undefined)
|
||||
if (move[0] === move[1] || game.board[move[1]] !== undefined)
|
||||
return; // ignore obviosly wrong move
|
||||
|
||||
if (game.status === 'DRAW_REQUEST_WAIT_FOR_YOU')
|
||||
return alert("You have to descide on Draw request from " + game.opponentName);
|
||||
|
||||
if (game.status === 'DRAW_REQUEST_WAIT_FOR_OPPONENT')
|
||||
return alert("Awating for " + game.opponentName + "'s decision on the Draw request");
|
||||
|
||||
onStoneMove(game.uuid, move)
|
||||
};
|
||||
|
||||
|
@ -133,12 +133,6 @@ function Selectable({ game, selected, onClick }) {
|
||||
const opponentName = game.opponentName;
|
||||
const flipBoard = (game?.myColor === Color.black) ? true : null;
|
||||
|
||||
const color = 'red';//game.status === 'DRAW_REQUEST_WAIT_FOR_YOU' || game.status === 'DRAW_REQUEST_WAIT_FOR_OPPONENT';
|
||||
|
||||
// const style = {
|
||||
// border: 1px 'red'
|
||||
// };
|
||||
|
||||
return (
|
||||
<div className={'Selectable' + (selected ? ' selected' : '')}
|
||||
onClick={() => onClick(game.uuid)}
|
||||
|
Loading…
Reference in New Issue
Block a user