<commit_before>import {
  searchRequestReset, resetQueryTracking, makeSearchRequest,
  QUERY_COMPONENT_ADD, QUERY_COMPONENT_MODIFY, QUERY_COMPONENT_REMOVE
} from '../../api/actions/query'
import QueryConstants  from '../../api/constants/QueryComponentConstants'
import { TRIGGER_SEARCH } from '../actions/Search'
import { SET_ACTIVE } from '../actions/Overlay'

const resetOverlayMiddleware = (namespaces) => (store) => (next) => (action) => {
  // Reset status of all namespaces if the overlay is closed
  if (action.type === SET_ACTIVE && action.active === false) {
    [].concat(namespaces).forEach(n => {
      store.dispatch(searchRequestReset(n))
      store.dispatch(resetQueryTracking(n))
    })
  }
  return next(action)<commit_msg>Refactored middleware to set namespaces to ‘default’ by default.<commit_after>import {
  searchRequestReset, resetQueryTracking, makeSearchRequest,
  QUERY_COMPONENT_ADD, QUERY_COMPONENT_MODIFY, QUERY_COMPONENT_REMOVE
} from '../../api/actions/query'
import QueryConstants  from '../../api/constants/QueryComponentConstants'
import { TRIGGER_SEARCH } from '../actions/Search'
import { SET_ACTIVE } from '../actions/Overlay'

const resetOverlayMiddleware = (namespaces = 'default') => (store) => (next) => (action) => {
  // Reset status of all namespaces if the overlay is closed
  if (action.type === SET_ACTIVE && action.active === false) {
    [].concat(namespaces).forEach(n => {
      store.dispatch(searchRequestReset(n))
      store.dispatch(resetQueryTracking(n))
    })
  }
  return next(action)
{'fraction_non_alphanumeric': 0.13851132686084142, 'fraction_numerical': 0.0, 'mean_word_length': 4.561151079136691, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '1662937', 'n_tokens_mistral': 464, 'n_tokens_neox': 470, 'n_words': 102}