Skip to content

Commit

Permalink
Fix issue with clicking on last bomb detected as win
Browse files Browse the repository at this point in the history
  • Loading branch information
deathgrindfreak committed Apr 21, 2017
1 parent a078e6d commit aaee191
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Grid extends Component {
difficultySelect(event) {
// Ensure that the interval is cleared
clearInterval(this.state.timer);

let d = event.target.value;
if (d === 'b')
this.setState(this.createState(9, 9, 10));
Expand Down Expand Up @@ -154,7 +154,7 @@ class Grid extends Component {
resetClicked() {
// Ensure that the previous timer is cleared
clearInterval(this.state.timer);

let w = this.state.width;
let h = this.state.height;
let n = this.state.numberOfBombs;
Expand Down Expand Up @@ -195,10 +195,10 @@ class Grid extends Component {
state[cell.position].clickCell();

// Set the state
if (cell.winnerClicked())
state = this.winGame(state, cell);
else if (cell.isBomb)
if (cell.isBomb)
state = this.endGame(state, cell);
else if (cell.winnerClicked())
state = this.winGame(state, cell);
else if (cell.isOpen)
state = this.openCells(state, cell);
this.setState({ boardState: state });
Expand Down

0 comments on commit aaee191

Please sign in to comment.