<commit_before>import React, { Component } from 'react'
import { isEmpty } from 'lodash'
// components
import Reviews from 'components/Reviews'
// redux
import { readMyReputation } from 'store/modules/data/reputation'
import { connect } from 'react-redux'

class Reputation extends Component {

  componentDidMount() {
    if (!this.props.loading) this.props.readMyReputation()
  }

  render() {
    const { reviews, loading } = this.props
    const reviewList = isEmpty(reviews) ? [] : Object.values(reviews)
    console.log(reviewList)
    return <div>
      <Reviews
        loading={loading}
        reviews={reviewList}
      />  
    </div>
  }
}

const mapStateToProps = state => ({
  reviews: state.data.reputation.reviews,
  loading: state.data.loading
})

const mapDispatchToProps = {
  readMyReputation
}

export default connect(mapStateToProps, mapDispatchToProps)(Reputation)<commit_msg>fix UI not showing reviews as loading in reviews about me<commit_after>import React, { Component } from 'react'
import { isEmpty } from 'lodash'
// components
import Reviews from 'components/Reviews'
// redux
import { readMyReputation } from 'store/modules/data/reputation'
import { connect } from 'react-redux'

class Reputation extends Component {

  componentDidMount() {
    if (!this.props.loading) this.props.readMyReputation()
  }

  render() {
    const { reviews, loading } = this.props
    const reviewList = isEmpty(reviews) ? [] : Object.values(reviews)
    console.log(reviewList)
    return <div>
      <Reviews
        loading={loading}
        reviews={reviewList}
      />  
    </div>
  }
}

const mapStateToProps = state => ({
  reviews: state.data.reputation.reviews,
  loading: state.data.reputation.loading
})

const mapDispatchToProps = {
  readMyReputation
}

export default connect(mapStateToProps, mapDispatchToProps)(Reputation)
{'fraction_non_alphanumeric': 0.11374663072776281, 'fraction_numerical': 0.0, 'mean_word_length': 3.783505154639175, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '2345154', 'n_tokens_mistral': 579, 'n_tokens_neox': 560, 'n_words': 131}