From f61845b876d86f11fd9e98c9b5a2cd85f8f37fd1 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 4 Nov 2021 13:41:56 -0500 Subject: [PATCH] Pull to Refresh on public timelines --- app/soapbox/features/community_timeline/index.js | 7 +++++++ app/soapbox/features/public_timeline/index.js | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/app/soapbox/features/community_timeline/index.js b/app/soapbox/features/community_timeline/index.js index 0789253fc..44ee6d45f 100644 --- a/app/soapbox/features/community_timeline/index.js +++ b/app/soapbox/features/community_timeline/index.js @@ -70,6 +70,12 @@ class CommunityTimeline extends React.PureComponent { dispatch(expandCommunityTimeline({ maxId, onlyMedia })); } + handleRefresh = () => { + const { dispatch, onlyMedia } = this.props; + return dispatch(expandCommunityTimeline({ onlyMedia })); + } + + render() { const { intl, onlyMedia, timelineId } = this.props; @@ -80,6 +86,7 @@ class CommunityTimeline extends React.PureComponent { scrollKey={`${timelineId}_timeline`} timelineId={`${timelineId}${onlyMedia ? ':media' : ''}`} onLoadMore={this.handleLoadMore} + onRefresh={this.handleRefresh} emptyMessage={} /> diff --git a/app/soapbox/features/public_timeline/index.js b/app/soapbox/features/public_timeline/index.js index 8083cf67e..1b3b0e358 100644 --- a/app/soapbox/features/public_timeline/index.js +++ b/app/soapbox/features/public_timeline/index.js @@ -94,6 +94,11 @@ class CommunityTimeline extends React.PureComponent { dispatch(expandPublicTimeline({ maxId, onlyMedia })); } + handleRefresh = () => { + const { dispatch, onlyMedia } = this.props; + return dispatch(expandPublicTimeline({ onlyMedia })); + } + render() { const { intl, onlyMedia, timelineId, siteTitle, showExplanationBox, explanationBoxExpanded } = this.props; @@ -130,6 +135,7 @@ class CommunityTimeline extends React.PureComponent { scrollKey={`${timelineId}_timeline`} timelineId={`${timelineId}${onlyMedia ? ':media' : ''}`} onLoadMore={this.handleLoadMore} + onRefresh={this.handleRefresh} emptyMessage={} />