<commit_before>import { FETCH_TOPIC_SEARCH_RESULTS } from '../../actions/topicActions';
import { createAsyncReducer } from '../../lib/reduxHelpers';

const search = createAsyncReducer({
  initialState: {
    topics: [],
  },
  action: FETCH_TOPIC_SEARCH_RESULTS,
});

export default search;<commit_msg>fix topic search results display<commit_after>import { FETCH_TOPIC_SEARCH_RESULTS } from '../../actions/topicActions';
import { createAsyncReducer } from '../../lib/reduxHelpers';
import { addLatestStateToTopicsList } from './personalList';

const search = createAsyncReducer({
  initialState: {
    topics: [],
  },
  action: FETCH_TOPIC_SEARCH_RESULTS,
  handleSuccess: payload => ({
    ...payload,
    topics: addLatestStateToTopicsList(payload.topics),
  }),
});

export default search;
{'fraction_non_alphanumeric': 0.14123581336696092, 'fraction_numerical': 0.0, 'mean_word_length': 4.631205673758865, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '494513', 'n_tokens_mistral': 250, 'n_tokens_neox': 249, 'n_words': 48}