<commit_before>// @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 };<commit_msg>[native] Use global NavContext for displayActionResultModal<commit_after>// @flow

import { NavigationActions } from 'react-navigation';
import invariant from 'invariant';

import { ActionResultModalRouteName } from './route-names';
import { getGlobalNavContext } from './icky-global';

function displayActionResultModal(message: string) {
  const navContext = getGlobalNavContext();
  invariant(navContext, 'navContext should be set in displayActionResultModal');
  navContext.dispatch(
    NavigationActions.navigate({
      routeName: ActionResultModalRouteName,
      params: { message },
    }),
  );
}

export { displayActionResultModal };
{'fraction_non_alphanumeric': 0.11534968210717529, 'fraction_numerical': 0.0, 'mean_word_length': 4.651282051282052, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4998715', 'n_tokens_mistral': 294, 'n_tokens_neox': 288, 'n_words': 74}