<commit_before>import PropTypes from 'prop-types'
import React from 'react'
import { connect } from 'react-redux'

import ComicList from './ComicList'

import Actions from '../../actions'
import { App } from '../../constants'

class ComicListContainer extends React.Component {
  static propTypes = {
    comics: PropTypes.object.isRequired,
    isFetching: PropTypes.bool.isRequired,
    fetchError: PropTypes.bool.isRequired,
    filter: PropTypes.object.isRequired,
    favorites: PropTypes.array.isRequired,
    match: PropTypes.object.isRequired,
    offset: PropTypes.number.isRequired,
    comicsPerPage: PropTypes.number.isRequired,
    dispatch: PropTypes.func.isRequired,
  }

  componentDidMount() {
    const { comics, dispatch } = this.props

    // Re-fetch when necessary
    // comic length would be 0 when user first time visits ComicList
    // comic length would be 1 if there has exact 1 comic fetched by other page
    // ex: Visit ComicList from ComicViewer along with an opened ComicDrawer<commit_msg>Always reset ComicList scrollbar to the top<commit_after>import PropTypes from 'prop-types'
import React from 'react'
import { connect } from 'react-redux'

import ComicList from './ComicList'

import Actions from '../../actions'
import { App } from '../../constants'

class ComicListContainer extends React.Component {
  static propTypes = {
    comics: PropTypes.object.isRequired,
    isFetching: PropTypes.bool.isRequired,
    fetchError: PropTypes.bool.isRequired,
    filter: PropTypes.object.isRequired,
    favorites: PropTypes.array.isRequired,
    match: PropTypes.object.isRequired,
    offset: PropTypes.number.isRequired,
    comicsPerPage: PropTypes.number.isRequired,
    dispatch: PropTypes.func.isRequired,
  }

  componentDidMount() {
    const { comics, dispatch } = this.props

    // Reset scrollbar to the top
    window.scrollTo(0, 0)

    // Re-fetch when necessary
    // comic length would be 0 when user first time visits ComicList
    // comic length would be 1 if there has exact 1 comic fetched by other page
    // ex: Visit ComicList from ComicViewer along with an opened ComicDrawer
{'fraction_non_alphanumeric': 0.09069658719027583, 'fraction_numerical': 0.0037400654511453952, 'mean_word_length': 3.6021505376344085, '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': '4145481', 'n_tokens_mistral': 599, 'n_tokens_neox': 600, 'n_words': 196}