<commit_before>import React from 'react';
import {connect} from 'react-redux';
import {createPost, resetPostCreateForm, expandSendTo} from '../redux/action-creators';
import {joinPostData, joinCreatePostData, postActions} from './select-utils';
import {getQuery} from '../utils';

import CreatePost from './create-post';
import Feed from './feed';
import PaginatedView from './paginated-view';
import Welcome from './welcome';

const FeedHandler = (props) => {
  const createPostComponent = (
    <CreatePost
      createPostViewState={props.createPostViewState}
      sendTo={props.sendTo}
      user={props.user}
      createPost={props.createPost}
      resetPostCreateForm={props.resetPostCreateForm}
      expandSendTo={props.expandSendTo}
      createPostForm={props.createPostForm}
      addAttachmentResponse={props.addAttachmentResponse}
      removeAttachment={props.removeAttachment}/>
  );

  return (
    <div className='box'>
      <div className='box-header-timeline'>
        {props.boxHeader}
      </div>
      <PaginatedView firstPageHead={createPostComponent} {...props}>
        <Feed {...props}/>
      </PaginatedView>
      <div className='box-footer'>
      </div>
    </div>);
};

function selectState(state) {
  const isLoading = state.routeLoadingState;
  const user = state.user;
  const authenticated = state.authenticated;
  const visibleEntries = state.feedViewState.visibleEntries.map(joinPostData(state));
  const createPostViewState = state.createPostViewState;
  const createPostForm = joinCreatePostData(state);
  const timelines = state.timelines;
  const boxHeader = state.boxHeader;
  const sendTo = {...state.sendTo, defaultFeed: null};

  return { isLoading, user, authenticated, visibleEntries, createPostViewState, createPostForm, timelines, boxHeader, sendTo };
}

function selectActions(dispatch) {
  return {<commit_msg>Set user's feed as default recipient in "My discussions"<commit_after>import React from 'react';
import {connect} from 'react-redux';
import {createPost, resetPostCreateForm, expandSendTo} from '../redux/action-creators';
import {joinPostData, joinCreatePostData, postActions} from './select-utils';
import {getQuery, getCurrentRouteName} from '../utils';

import CreatePost from './create-post';
import Feed from './feed';
import PaginatedView from './paginated-view';
import Welcome from './welcome';

const FeedHandler = (props) => {
  const createPostComponent = (
    <CreatePost
      createPostViewState={props.createPostViewState}
      sendTo={props.sendTo}
      user={props.user}
      createPost={props.createPost}
      resetPostCreateForm={props.resetPostCreateForm}
      expandSendTo={props.expandSendTo}
      createPostForm={props.createPostForm}
      addAttachmentResponse={props.addAttachmentResponse}
      removeAttachment={props.removeAttachment}/>
  );

  return (
    <div className='box'>
      <div className='box-header-timeline'>
        {props.boxHeader}
      </div>
      <PaginatedView firstPageHead={createPostComponent} {...props}>
        <Feed {...props}/>
      </PaginatedView>
      <div className='box-footer'>
      </div>
    </div>);
};

function selectState(state, ownProps) {
  const isLoading = state.routeLoadingState;
  const user = state.user;
  const authenticated = state.authenticated;
  const visibleEntries = state.feedViewState.visibleEntries.map(joinPostData(state));
  const createPostViewState = state.createPostViewState;
  const createPostForm = joinCreatePostData(state);
  const timelines = state.timelines;
  const boxHeader = state.boxHeader;

  const defaultFeed = (getCurrentRouteName(ownProps) === 'discussions' ? user.username : null);
  const sendTo = {...state.sendTo, defaultFeed};

  return { isLoading, user, authenticated, visibleEntries, createPostViewState, createPostForm, timelines, boxHeader, sendTo };
}

function selectActions(dispatch) {
  return {
{'fraction_non_alphanumeric': 0.12208258527827648, 'fraction_numerical': 0.0, 'mean_word_length': 4.386740331491713, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 25, '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': '100654', 'n_tokens_mistral': 1115, 'n_tokens_neox': 1108, 'n_words': 247}