// @flow

import { NavigationActions } from 'react-navigation';

import { dispatch } from '../redux/redux-setup';
import { ActionResultModalRouteName } from './route-names';

function displayActionResultModal(message: string) {
  dispatch({
    // We do this for Flow
    ...NavigationActions.navigate({
      routeName: ActionResultModalRouteName,
      params: { message },
    }),
  });
}

export { displayActionResultModal };

@@ -61,58 +61,44 @@
 n';%0A
-%0A
 import 
-%7B dispatch %7D from '../redux/redux-setup
+invariant from 'invariant
 ';%0A
+%0A
 impo
@@ -152,16 +152,69 @@
 -names';
+%0Aimport %7B getGlobalNavContext %7D from './icky-global';
 %0A%0Afuncti
@@ -266,53 +266,158 @@
 %7B%0A  
-dispatch(%7B%0A    // We do this for Flow
+const navContext = getGlobalNavContext();%0A  invariant(navContext, 'navContext should be set in displayActionResultModal');%0A  navContext.dispatch(
 %0A    
-...
 Navi
@@ -523,17 +523,16 @@
   %7D),%0A  
-%7D
 );%0A%7D%0A%0Aex

Use global NavContext for displayActionResultModal