Pull to Refresh on public timelines
This commit is contained in:
parent
9ce3aa8d1b
commit
f61845b876
|
@ -70,6 +70,12 @@ class CommunityTimeline extends React.PureComponent {
|
||||||
dispatch(expandCommunityTimeline({ maxId, onlyMedia }));
|
dispatch(expandCommunityTimeline({ maxId, onlyMedia }));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleRefresh = () => {
|
||||||
|
const { dispatch, onlyMedia } = this.props;
|
||||||
|
return dispatch(expandCommunityTimeline({ onlyMedia }));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { intl, onlyMedia, timelineId } = this.props;
|
const { intl, onlyMedia, timelineId } = this.props;
|
||||||
|
|
||||||
|
@ -80,6 +86,7 @@ class CommunityTimeline extends React.PureComponent {
|
||||||
scrollKey={`${timelineId}_timeline`}
|
scrollKey={`${timelineId}_timeline`}
|
||||||
timelineId={`${timelineId}${onlyMedia ? ':media' : ''}`}
|
timelineId={`${timelineId}${onlyMedia ? ':media' : ''}`}
|
||||||
onLoadMore={this.handleLoadMore}
|
onLoadMore={this.handleLoadMore}
|
||||||
|
onRefresh={this.handleRefresh}
|
||||||
emptyMessage={<FormattedMessage id='empty_column.community' defaultMessage='The local timeline is empty. Write something publicly to get the ball rolling!' />}
|
emptyMessage={<FormattedMessage id='empty_column.community' defaultMessage='The local timeline is empty. Write something publicly to get the ball rolling!' />}
|
||||||
/>
|
/>
|
||||||
</Column>
|
</Column>
|
||||||
|
|
|
@ -94,6 +94,11 @@ class CommunityTimeline extends React.PureComponent {
|
||||||
dispatch(expandPublicTimeline({ maxId, onlyMedia }));
|
dispatch(expandPublicTimeline({ maxId, onlyMedia }));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleRefresh = () => {
|
||||||
|
const { dispatch, onlyMedia } = this.props;
|
||||||
|
return dispatch(expandPublicTimeline({ onlyMedia }));
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { intl, onlyMedia, timelineId, siteTitle, showExplanationBox, explanationBoxExpanded } = this.props;
|
const { intl, onlyMedia, timelineId, siteTitle, showExplanationBox, explanationBoxExpanded } = this.props;
|
||||||
|
|
||||||
|
@ -130,6 +135,7 @@ class CommunityTimeline extends React.PureComponent {
|
||||||
scrollKey={`${timelineId}_timeline`}
|
scrollKey={`${timelineId}_timeline`}
|
||||||
timelineId={`${timelineId}${onlyMedia ? ':media' : ''}`}
|
timelineId={`${timelineId}${onlyMedia ? ':media' : ''}`}
|
||||||
onLoadMore={this.handleLoadMore}
|
onLoadMore={this.handleLoadMore}
|
||||||
|
onRefresh={this.handleRefresh}
|
||||||
emptyMessage={<FormattedMessage id='empty_column.public' defaultMessage='There is nothing here! Write something publicly, or manually follow users from other servers to fill it up' />}
|
emptyMessage={<FormattedMessage id='empty_column.public' defaultMessage='There is nothing here! Write something publicly, or manually follow users from other servers to fill it up' />}
|
||||||
/>
|
/>
|
||||||
</Column>
|
</Column>
|
||||||
|
|
Loading…
Reference in New Issue