From 6982f5aa24240ac6049d5c3742bf9aa65993ca7f Mon Sep 17 00:00:00 2001 From: Fred Liu Date: Tue, 21 Jun 2016 13:34:53 -0700 Subject: [PATCH] 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 --- Libraries/CustomComponents/Navigator/Navigator.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/CustomComponents/Navigator/Navigator.js b/Libraries/CustomComponents/Navigator/Navigator.js index 1a685bb29..84a077899 100644 --- a/Libraries/CustomComponents/Navigator/Navigator.js +++ b/Libraries/CustomComponents/Navigator/Navigator.js @@ -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;