[RN] Fix _getRouteToRender after Deeplinking (#2760)

This commit is contained in:
Lyubo Marinov 2018-04-15 23:14:50 -05:00
parent e30d141cec
commit eac74aa0b7
1 changed files with 13 additions and 2 deletions

View File

@ -77,9 +77,20 @@ function _connectionEstablished(store, next, action) {
function _navigate({ getState }) { function _navigate({ getState }) {
const state = getState(); const state = getState();
const { app } = state['features/app']; const { app } = state['features/app'];
const routeToRender = _getRouteToRender(state);
_getRouteToRender(state) // XXX Web changed _getRouteToRender to return Promsie instead of Route.
.then(routeToRender => app._navigate(routeToRender)); // Unfortunately, the commit left mobile to return Route.
let routeToRenderPromise;
if (routeToRender && typeof routeToRender.then === 'function') {
routeToRenderPromise = routeToRender;
}
if (!routeToRenderPromise) {
routeToRenderPromise = Promise.resolve(routeToRender);
}
routeToRenderPromise.then(app._navigate.bind(app));
} }
/** /**