Private
Public Access
1
0

bugfix multiple empty fields w/ one click on opponent view

This commit is contained in:
2016-10-28 18:54:59 +02:00
parent 0a22968e56
commit 2468dca361

View File

@@ -64,12 +64,6 @@ class GridControl extends React.Component {
if (this.checkMine(row, col)) { if (this.checkMine(row, col)) {
var currentField = this.refs[this.refString(row, col)]; var currentField = this.refs[this.refString(row, col)];
currentField.setState({
currentImage: this.state.grid[row][col],
currentObj: this.state.grid[row][col],
active: true
});
/** /**
* It must be cached because the GridField.state not updated until * It must be cached because the GridField.state not updated until
* all showAppropriateFields() method runned out!! * all showAppropriateFields() method runned out!!
@@ -77,6 +71,12 @@ class GridControl extends React.Component {
if (this.state.updatedFieldCache.indexOf(this.refString(row, col)) < 0 && !currentField.state.active) { if (this.state.updatedFieldCache.indexOf(this.refString(row, col)) < 0 && !currentField.state.active) {
this.state.updatedFieldCache.push(this.refString(row, col)); this.state.updatedFieldCache.push(this.refString(row, col));
currentField.setState({
currentImage: this.state.grid[row][col],
currentObj: this.state.grid[row][col],
active: true
});
if (this.state.grid[row][col] === 0) { if (this.state.grid[row][col] === 0) {
return { return {
row: row, row: row,