mirror of
https://github.com/danbee/chess
synced 2025-03-04 08:39:06 +00:00
Hound cleanups
This commit is contained in:
parent
1c6ff47d8b
commit
e23980537b
@ -11,8 +11,7 @@ import { Provider } from "react-redux";
|
||||
import Channel from "./services/channel";
|
||||
|
||||
import chessBoardReducer from "./reducers/chess-board";
|
||||
import { setPlayer, setGame, setGameId } from "./store/actions";
|
||||
import ChessBoard from "./components/chess-board";
|
||||
import { setGameId } from "./store/actions";
|
||||
|
||||
const store = createStore(chessBoardReducer);
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ class ChessBoardSquare extends React.Component {
|
||||
sendMove(gameId, {
|
||||
from: selectedSquare,
|
||||
to: this.squareCoords,
|
||||
})
|
||||
});
|
||||
} else if (selectedSquare != null) {
|
||||
store.dispatch(selectPiece(null));
|
||||
} else if (this.playerCanSelectPiece(player, piece)) {
|
||||
|
||||
@ -21,7 +21,7 @@ class Channel {
|
||||
this.channel.on("game:update", data => {
|
||||
if (data.player != undefined) {
|
||||
this.store.dispatch(setPlayer(data.player));
|
||||
};
|
||||
}
|
||||
this.store.dispatch(setGame(data));
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user