Reset when tile.HasMine triggered infinite loop
This commit is contained in:
parent
efc03de60f
commit
9d2f8cd469
|
@ -234,6 +234,7 @@ export default class Minesweeper extends React.Component<IMinesweeperProps, IMin
|
|||
case GameStatus.Idle: // first click starting the game
|
||||
while(tile.hasMine){
|
||||
grid = this.initGrid(this.state.settings);
|
||||
tile = grid[coord.row][coord.col];
|
||||
}
|
||||
|
||||
this.setState({
|
||||
|
|
Loading…
Reference in New Issue