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 Channel from "./services/channel";
|
||||||
|
|
||||||
import chessBoardReducer from "./reducers/chess-board";
|
import chessBoardReducer from "./reducers/chess-board";
|
||||||
import { setPlayer, setGame, setGameId } from "./store/actions";
|
import { setGameId } from "./store/actions";
|
||||||
import ChessBoard from "./components/chess-board";
|
|
||||||
|
|
||||||
const store = createStore(chessBoardReducer);
|
const store = createStore(chessBoardReducer);
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class ChessBoardSquare extends React.Component {
|
|||||||
sendMove(gameId, {
|
sendMove(gameId, {
|
||||||
from: selectedSquare,
|
from: selectedSquare,
|
||||||
to: this.squareCoords,
|
to: this.squareCoords,
|
||||||
})
|
});
|
||||||
} else if (selectedSquare != null) {
|
} else if (selectedSquare != null) {
|
||||||
store.dispatch(selectPiece(null));
|
store.dispatch(selectPiece(null));
|
||||||
} else if (this.playerCanSelectPiece(player, piece)) {
|
} else if (this.playerCanSelectPiece(player, piece)) {
|
||||||
|
|||||||
@ -21,7 +21,7 @@ class Channel {
|
|||||||
this.channel.on("game:update", data => {
|
this.channel.on("game:update", data => {
|
||||||
if (data.player != undefined) {
|
if (data.player != undefined) {
|
||||||
this.store.dispatch(setPlayer(data.player));
|
this.store.dispatch(setPlayer(data.player));
|
||||||
};
|
}
|
||||||
this.store.dispatch(setGame(data));
|
this.store.dispatch(setGame(data));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user