1
0
mirror of https://github.com/danbee/chess synced 2025-03-04 08:39:06 +00:00

Stop pieces from fucking disappearing

This commit is contained in:
Rob Whittaker 2016-12-09 16:45:30 +00:00 committed by Dan Barber
parent 22cfeda740
commit eb6537cfe9

View File

@ -4,7 +4,11 @@ import movePiece from "./move-piece";
const chessBoardReducer = (state = defaultState, action) => {
switch (action.type) {
case "SET_BOARD":
return Object.assign({}, state, { board: action.board });
return Object.assign(
{},
state,
{ board: action.board, selectedSquare: null }
);
case "SET_GAME_ID":
return Object.assign({}, state, { gameId: action.gameId });