diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2017-06-11 17:07:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-11 17:07:35 +0200 |
commit | 47bf7a8047ce59b899d147e4483168f9852eeb7c (patch) | |
tree | 79dd51ed84b1ed350cd754c8fca988dd6718a93a /app/javascript/mastodon/features/hashtag_timeline | |
parent | 85d405c810a3bfc146c7901d770444419f32e46f (diff) |
Fix #3665 - Refactor timelines reducer (#3686)
* Move ancestors/descendants out of timelines reducer * Refactor timelines reducer All types of timelines now have a flat structure and use the same reducer functions and actions * Reintroduce some missing behaviours * Fix wrong import in reports * Fix includes typo * Fix issue related to "next" pagination in timelines and notifications * Fix bug with timeline's initial state, expandNotifications
Diffstat (limited to 'app/javascript/mastodon/features/hashtag_timeline')
-rw-r--r-- | app/javascript/mastodon/features/hashtag_timeline/index.js | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/app/javascript/mastodon/features/hashtag_timeline/index.js b/app/javascript/mastodon/features/hashtag_timeline/index.js index 05e6d1996..ba6dbe6e5 100644 --- a/app/javascript/mastodon/features/hashtag_timeline/index.js +++ b/app/javascript/mastodon/features/hashtag_timeline/index.js @@ -5,7 +5,8 @@ import StatusListContainer from '../ui/containers/status_list_container'; import Column from '../../components/column'; import ColumnHeader from '../../components/column_header'; import { - refreshTimeline, + refreshHashtagTimeline, + expandHashtagTimeline, updateTimeline, deleteFromTimelines, } from '../../actions/timelines'; @@ -81,13 +82,13 @@ class HashtagTimeline extends React.PureComponent { const { dispatch } = this.props; const { id } = this.props.params; - dispatch(refreshTimeline('tag', id)); + dispatch(refreshHashtagTimeline(id)); this._subscribe(dispatch, id); } componentWillReceiveProps (nextProps) { if (nextProps.params.id !== this.props.params.id) { - this.props.dispatch(refreshTimeline('tag', nextProps.params.id)); + this.props.dispatch(refreshHashtagTimeline(nextProps.params.id)); this._unsubscribe(); this._subscribe(this.props.dispatch, nextProps.params.id); } @@ -101,6 +102,10 @@ class HashtagTimeline extends React.PureComponent { this.column = c; } + handleLoadMore = () => { + this.props.dispatch(expandHashtagTimeline(this.props.params.id)); + } + render () { const { hasUnread, columnId, multiColumn } = this.props; const { id } = this.props.params; @@ -123,8 +128,8 @@ class HashtagTimeline extends React.PureComponent { <StatusListContainer trackScroll={!pinned} scrollKey={`hashtag_timeline-${columnId}`} - type='tag' - id={id} + timelineId={`hashtag:${id}`} + loadMore={this.handleLoadMore} emptyMessage={<FormattedMessage id='empty_column.hashtag' defaultMessage='There is nothing in this hashtag yet.' />} /> </Column> |