mirror of
https://github.com/danbee/chess
synced 2025-03-04 08:39:06 +00:00
Fix problem with null selectedSquare
This commit is contained in:
parent
397cf146a1
commit
e7933b5661
@ -28,9 +28,14 @@ class ChessBoardSquare extends React.Component {
|
|||||||
isSelectedSquare() {
|
isSelectedSquare() {
|
||||||
var { store } = this.props;
|
var { store } = this.props;
|
||||||
|
|
||||||
|
if (store.getState().selectedSquare == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
return this.squareCoords().rank == store.getState().selectedSquare.rank
|
return this.squareCoords().rank == store.getState().selectedSquare.rank
|
||||||
&& this.squareCoords().file == store.getState().selectedSquare.file;
|
&& this.squareCoords().file == store.getState().selectedSquare.file;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
if (this.props.piece == undefined) {
|
if (this.props.piece == undefined) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user