From 2468dca361682177275b375c785ed8e7bb8963ee Mon Sep 17 00:00:00 2001 From: Lang Date: Fri, 28 Oct 2016 18:54:59 +0200 Subject: [PATCH] bugfix multiple empty fields w/ one click on opponent view --- .../public/js/mine-seeker/grid/grid-control.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Mine/SeekerBundle/Resources/public/js/mine-seeker/grid/grid-control.js b/src/Mine/SeekerBundle/Resources/public/js/mine-seeker/grid/grid-control.js index bc42488..b85611e 100644 --- a/src/Mine/SeekerBundle/Resources/public/js/mine-seeker/grid/grid-control.js +++ b/src/Mine/SeekerBundle/Resources/public/js/mine-seeker/grid/grid-control.js @@ -64,12 +64,6 @@ class GridControl extends React.Component { if (this.checkMine(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 * 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) { 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) { return { row: row,