Fix Navigator jumpTo same route issue

Summary: https://github.com/facebook/react-native/pull/8071 introduced a bug where jumping to the same navigator route would show a blank screen since the `index` check is not catching cases where the `transitionQueue` is empty.

Reviewed By: ericvicenti

Differential Revision: D3464697

fbshipit-source-id: 494527d1fb0ac5aea394abd3231dd19c56596549
This commit is contained in:
Fred Liu 2016-06-21 13:34:53 -07:00 committed by Facebook Github Bot 4
parent 6668cd2129
commit 6982f5aa24
1 changed files with 3 additions and 3 deletions

View File

@ -373,9 +373,6 @@ var Navigator = React.createClass({
},
_transitionTo: function(destIndex, velocity, jumpSpringTo, cb) {
if (destIndex === this.state.presentedIndex && this.state.transitionQueue.length > 0) {
return;
}
if (this.state.transitionFromIndex !== null) {
this.state.transitionQueue.push({
destIndex,
@ -384,6 +381,9 @@ var Navigator = React.createClass({
});
return;
}
if (destIndex === this.state.presentedIndex) {
return;
}
this.state.transitionFromIndex = this.state.presentedIndex;
this.state.presentedIndex = destIndex;
this.state.transitionCb = cb;