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:
parent
22cfeda740
commit
eb6537cfe9
@ -4,7 +4,11 @@ import movePiece from "./move-piece";
|
|||||||
const chessBoardReducer = (state = defaultState, action) => {
|
const chessBoardReducer = (state = defaultState, action) => {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case "SET_BOARD":
|
case "SET_BOARD":
|
||||||
return Object.assign({}, state, { board: action.board });
|
return Object.assign(
|
||||||
|
{},
|
||||||
|
state,
|
||||||
|
{ board: action.board, selectedSquare: null }
|
||||||
|
);
|
||||||
|
|
||||||
case "SET_GAME_ID":
|
case "SET_GAME_ID":
|
||||||
return Object.assign({}, state, { gameId: action.gameId });
|
return Object.assign({}, state, { gameId: action.gameId });
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user