diff options
author | Yamagishi Kazutoshi <ykzts@desire.sh> | 2018-03-12 20:47:18 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2018-03-12 12:47:18 +0100 |
commit | 6ae70a92c91233d4c299e679b3e04ba8e2a7002f (patch) | |
tree | 760e80800df6a6e76931a8888e77356dae3b861e /app/javascript | |
parent | fa5c867e0ec426fc01653e9022ba29783b2a826f (diff) |
Hide pinned toots on with replies (#6753)
Diffstat (limited to 'app/javascript')
-rw-r--r-- | app/javascript/mastodon/features/account_timeline/index.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/javascript/mastodon/features/account_timeline/index.js b/app/javascript/mastodon/features/account_timeline/index.js index f5f2475ea..5e21cf7c6 100644 --- a/app/javascript/mastodon/features/account_timeline/index.js +++ b/app/javascript/mastodon/features/account_timeline/index.js @@ -17,7 +17,7 @@ const mapStateToProps = (state, { params: { accountId }, withReplies = false }) return { statusIds: state.getIn(['timelines', `account:${path}`, 'items'], ImmutableList()), - featuredStatusIds: state.getIn(['timelines', `account:${accountId}:pinned`, 'items'], ImmutableList()), + featuredStatusIds: withReplies ? ImmutableList() : state.getIn(['timelines', `account:${accountId}:pinned`, 'items'], ImmutableList()), isLoading: state.getIn(['timelines', `account:${path}`, 'isLoading']), hasMore: !!state.getIn(['timelines', `account:${path}`, 'next']), }; @@ -40,14 +40,18 @@ export default class AccountTimeline extends ImmutablePureComponent { const { params: { accountId }, withReplies } = this.props; this.props.dispatch(fetchAccount(accountId)); - this.props.dispatch(refreshAccountFeaturedTimeline(accountId)); + if (!withReplies) { + this.props.dispatch(refreshAccountFeaturedTimeline(accountId)); + } this.props.dispatch(refreshAccountTimeline(accountId, withReplies)); } componentWillReceiveProps (nextProps) { if ((nextProps.params.accountId !== this.props.params.accountId && nextProps.params.accountId) || nextProps.withReplies !== this.props.withReplies) { this.props.dispatch(fetchAccount(nextProps.params.accountId)); - this.props.dispatch(refreshAccountFeaturedTimeline(nextProps.params.accountId)); + if (!nextProps.withReplies) { + this.props.dispatch(refreshAccountFeaturedTimeline(nextProps.params.accountId)); + } this.props.dispatch(refreshAccountTimeline(nextProps.params.accountId, nextProps.params.withReplies)); } } |