0
0
Fork 0

Add local only to hashtag timeline (#13502)

This commit is contained in:
Takeshi Umeda 2020-04-19 04:52:39 +09:00 committed by GitHub
parent a1ce9cbb67
commit 2c7128c7f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 36 additions and 17 deletions

View file

@ -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 }));
}
}