Skip to content

Commit

Permalink
[Navigator] Fix overswipe to -1, move guard
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Vicenti committed Jun 23, 2015
1 parent d105ae7 commit 0c38229
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Libraries/CustomComponents/Navigator/Navigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,13 +412,11 @@ var Navigator = React.createClass({
);
} else if (this.state.activeGesture != null) {
var presentedToIndex = this.state.presentedIndex + this._deltaForGestureAction(this.state.activeGesture);
if (presentedToIndex > -1) {
this._transitionBetween(
this.state.presentedIndex,
presentedToIndex,
this.spring.getCurrentValue()
);
}
this._transitionBetween(
this.state.presentedIndex,
presentedToIndex,
this.spring.getCurrentValue()
);
}
},

Expand Down Expand Up @@ -822,7 +820,7 @@ var Navigator = React.createClass({
this._transitionSceneStyle(fromIndex, toIndex, progress, fromIndex);
this._transitionSceneStyle(fromIndex, toIndex, progress, toIndex);
var navBar = this._navBar;
if (navBar && navBar.updateProgress) {
if (navBar && navBar.updateProgress && toIndex >= 0 && fromIndex >= 0) {
navBar.updateProgress(progress, fromIndex, toIndex);
}
},
Expand Down

0 comments on commit 0c38229

Please sign in to comment.