From 7ceeb97f3d0b67bd51ab915ce285f935e25d8c36 Mon Sep 17 00:00:00 2001 From: Takeshi Umeda Date: Sun, 19 Apr 2020 04:52:39 +0900 Subject: [Glitch] Add local only to hashtag timeline Port front-end changes from 2c7128c7f0ee3073acb9897cda88255982368193 to glitch-soc Signed-off-by: Thibaut Girka --- .../glitch/features/standalone/hashtag_timeline/index.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'app/javascript/flavours/glitch/features/standalone/hashtag_timeline') diff --git a/app/javascript/flavours/glitch/features/standalone/hashtag_timeline/index.js b/app/javascript/flavours/glitch/features/standalone/hashtag_timeline/index.js index 4fbd504ef..629f5c2ea 100644 --- a/app/javascript/flavours/glitch/features/standalone/hashtag_timeline/index.js +++ b/app/javascript/flavours/glitch/features/standalone/hashtag_timeline/index.js @@ -24,19 +24,25 @@ class HashtagTimeline extends React.PureComponent { isLoading: PropTypes.bool.isRequired, hasMore: PropTypes.bool.isRequired, hashtag: PropTypes.string.isRequired, + local: PropTypes.bool.isRequired, + }; + + static defaultProps = { + local: false, }; componentDidMount () { - const { dispatch, hashtag } = this.props; + const { dispatch, hashtag, local } = this.props; - dispatch(expandHashtagTimeline(hashtag)); + dispatch(expandHashtagTimeline(hashtag, { local })); } handleLoadMore = () => { - const maxId = this.props.statusIds.last(); + const { dispatch, hashtag, local, statusIds } = this.props; + const maxId = statusIds.last(); if (maxId) { - this.props.dispatch(expandHashtagTimeline(this.props.hashtag, { maxId })); + dispatch(expandHashtagTimeline(hashtag, { maxId, local })); } } -- cgit