mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-23 15:42:34 +01:00
Hide pinned toots on with replies (#6753)
This commit is contained in:
parent
fa5c867e0e
commit
6ae70a92c9
1 changed files with 7 additions and 3 deletions
|
@ -17,7 +17,7 @@ const mapStateToProps = (state, { params: { accountId }, withReplies = false })
|
||||||
|
|
||||||
return {
|
return {
|
||||||
statusIds: state.getIn(['timelines', `account:${path}`, 'items'], ImmutableList()),
|
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']),
|
isLoading: state.getIn(['timelines', `account:${path}`, 'isLoading']),
|
||||||
hasMore: !!state.getIn(['timelines', `account:${path}`, 'next']),
|
hasMore: !!state.getIn(['timelines', `account:${path}`, 'next']),
|
||||||
};
|
};
|
||||||
|
@ -40,14 +40,18 @@ export default class AccountTimeline extends ImmutablePureComponent {
|
||||||
const { params: { accountId }, withReplies } = this.props;
|
const { params: { accountId }, withReplies } = this.props;
|
||||||
|
|
||||||
this.props.dispatch(fetchAccount(accountId));
|
this.props.dispatch(fetchAccount(accountId));
|
||||||
|
if (!withReplies) {
|
||||||
this.props.dispatch(refreshAccountFeaturedTimeline(accountId));
|
this.props.dispatch(refreshAccountFeaturedTimeline(accountId));
|
||||||
|
}
|
||||||
this.props.dispatch(refreshAccountTimeline(accountId, withReplies));
|
this.props.dispatch(refreshAccountTimeline(accountId, withReplies));
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps (nextProps) {
|
componentWillReceiveProps (nextProps) {
|
||||||
if ((nextProps.params.accountId !== this.props.params.accountId && nextProps.params.accountId) || nextProps.withReplies !== this.props.withReplies) {
|
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(fetchAccount(nextProps.params.accountId));
|
||||||
|
if (!nextProps.withReplies) {
|
||||||
this.props.dispatch(refreshAccountFeaturedTimeline(nextProps.params.accountId));
|
this.props.dispatch(refreshAccountFeaturedTimeline(nextProps.params.accountId));
|
||||||
|
}
|
||||||
this.props.dispatch(refreshAccountTimeline(nextProps.params.accountId, nextProps.params.withReplies));
|
this.props.dispatch(refreshAccountTimeline(nextProps.params.accountId, nextProps.params.withReplies));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue