Skip to content

Commit

Permalink
Fix Sabaki not being able to undo a flatten node operation
Browse files Browse the repository at this point in the history
  • Loading branch information
yishn committed May 8, 2017
1 parent 63c4b88 commit 8283211
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file.

**Fixed**

* Fix Sabaki not being able to undo a flatten node operation
* Fix Sabaki incorrectly setting `HA` and `AB` properties when there are no handicap stones
* Fix Sabaki sometimes not saving comments when comment box is focused
* Fix Sabaki crashing when checking for updates without internet connection
Expand Down
6 changes: 3 additions & 3 deletions components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ class App extends Component {

// Navigation

setCurrentTreePosition(tree, index) {
setCurrentTreePosition(tree, index, {clearUndoPoint = true} = {}) {
if (['scoring', 'estimator'].includes(this.state.mode))
return

Expand All @@ -1148,7 +1148,7 @@ class App extends Component {
t = t.parent
}

if (t !== gametree.getRoot(this.state.treePosition[0])) {
if (clearUndoPoint && t !== gametree.getRoot(this.state.treePosition[0])) {
this.clearUndoPoint()
}

Expand Down Expand Up @@ -1592,7 +1592,7 @@ class App extends Component {

gameTrees[gameIndex] = clone
this.setState({gameTrees})
this.setCurrentTreePosition(clone, 0)
this.setCurrentTreePosition(clone, 0, {clearUndoPoint: false})
}

makeMainVariation(tree, index, {setUndoPoint = true} = {}) {
Expand Down

0 comments on commit 8283211

Please sign in to comment.