diff --git a/app/javascript/mastodon/features/followers/index.js b/app/javascript/mastodon/features/followers/index.js index ed7119cda6c3ef641323d4fc4436c640ed49904d..5120a5747e2cc02e7a11a34b6f74d5bf55c2c311 100644 --- a/app/javascript/mastodon/features/followers/index.js +++ b/app/javascript/mastodon/features/followers/index.js @@ -18,6 +18,7 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; const mapStateToProps = (state, props) => ({ accountIds: state.getIn(['user_lists', 'followers', Number(props.params.accountId), 'items']), + hasMore: !!state.getIn(['user_lists', 'followers', Number(props.params.accountId), 'next']), }); class Followers extends ImmutablePureComponent { @@ -54,7 +55,9 @@ class Followers extends ImmutablePureComponent { } render () { - const { accountIds } = this.props; + const { accountIds, hasMore } = this.props; + + let loadMore = null; if (!accountIds) { return ( @@ -64,6 +67,10 @@ class Followers extends ImmutablePureComponent { ); } + if (hasMore) { + loadMore = <LoadMore onClick={this.handleLoadMore} />; + } + return ( <Column> <ColumnBackButton /> @@ -73,7 +80,7 @@ class Followers extends ImmutablePureComponent { <div className='followers'> <HeaderContainer accountId={this.props.params.accountId} /> {accountIds.map(id => <AccountContainer key={id} id={id} withNote={false} />)} - <LoadMore onClick={this.handleLoadMore} /> + {loadMore} </div> </div> </ScrollContainer> diff --git a/app/javascript/mastodon/features/following/index.js b/app/javascript/mastodon/features/following/index.js index dd7ab4d46d1003e8f590d404df96165b6ce1cb50..e7be0f084be6dcae7a994a7d0873d146e531b475 100644 --- a/app/javascript/mastodon/features/following/index.js +++ b/app/javascript/mastodon/features/following/index.js @@ -18,6 +18,7 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; const mapStateToProps = (state, props) => ({ accountIds: state.getIn(['user_lists', 'following', Number(props.params.accountId), 'items']), + hasMore: !!state.getIn(['user_lists', 'following', Number(props.params.accountId), 'next']), }); class Following extends ImmutablePureComponent { @@ -54,7 +55,9 @@ class Following extends ImmutablePureComponent { } render () { - const { accountIds } = this.props; + const { accountIds, hasMore } = this.props; + + let loadMore = null; if (!accountIds) { return ( @@ -64,6 +67,10 @@ class Following extends ImmutablePureComponent { ); } + if (hasMore) { + loadMore = <LoadMore onClick={this.handleLoadMore} />; + } + return ( <Column> <ColumnBackButton /> @@ -73,7 +80,7 @@ class Following extends ImmutablePureComponent { <div className='following'> <HeaderContainer accountId={this.props.params.accountId} /> {accountIds.map(id => <AccountContainer key={id} id={id} withNote={false} />)} - <LoadMore onClick={this.handleLoadMore} /> + {loadMore} </div> </div> </ScrollContainer>