diff options
Diffstat (limited to 'app/javascript/mastodon/features/account_timeline/index.js')
-rw-r--r-- | app/javascript/mastodon/features/account_timeline/index.js | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/app/javascript/mastodon/features/account_timeline/index.js b/app/javascript/mastodon/features/account_timeline/index.js index fb76f4d2e..4a7ac3eba 100644 --- a/app/javascript/mastodon/features/account_timeline/index.js +++ b/app/javascript/mastodon/features/account_timeline/index.js @@ -24,24 +24,28 @@ const mapStateToProps = (state, props) => ({ class AccountTimeline extends ImmutablePureComponent { - constructor (props, context) { - super(props, context); - this.handleScrollToBottom = this.handleScrollToBottom.bind(this); - } + static propTypes = { + params: PropTypes.object.isRequired, + dispatch: PropTypes.func.isRequired, + statusIds: ImmutablePropTypes.list, + isLoading: PropTypes.bool, + hasMore: PropTypes.bool, + me: PropTypes.number.isRequired + }; componentWillMount () { this.props.dispatch(fetchAccount(Number(this.props.params.accountId))); this.props.dispatch(fetchAccountTimeline(Number(this.props.params.accountId))); } - componentWillReceiveProps(nextProps) { + componentWillReceiveProps (nextProps) { if (nextProps.params.accountId !== this.props.params.accountId && nextProps.params.accountId) { this.props.dispatch(fetchAccount(Number(nextProps.params.accountId))); this.props.dispatch(fetchAccountTimeline(Number(nextProps.params.accountId))); } } - handleScrollToBottom () { + handleScrollToBottom = () => { if (!this.props.isLoading && this.props.hasMore) { this.props.dispatch(expandAccountTimeline(Number(this.props.params.accountId))); } @@ -77,13 +81,4 @@ class AccountTimeline extends ImmutablePureComponent { } -AccountTimeline.propTypes = { - params: PropTypes.object.isRequired, - dispatch: PropTypes.func.isRequired, - statusIds: ImmutablePropTypes.list, - isLoading: PropTypes.bool, - hasMore: PropTypes.bool, - me: PropTypes.number.isRequired -}; - export default connect(mapStateToProps)(AccountTimeline); |