[RN] Fix _getRouteToRender after Deeplinking (#2760)
This commit is contained in:
parent
e30d141cec
commit
eac74aa0b7
|
@ -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));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue