about summary refs log tree commit diff
path: root/app/javascript/mastodon/features/followers/index.js
diff options
context:
space:
mode:
authorNaoki Kosaka <n.k@mail.yukimochi.net>2017-06-05 21:13:20 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-06-05 14:13:20 +0200
commit1f1d6bf2a07219c9dfd04db5b98e31a0543a7427 (patch)
treed30ba8fdcdf87365b5fa90c7c2dc6f6b36e73224 /app/javascript/mastodon/features/followers/index.js
parent4c06d1cb241020f2407a6be01b584c508a06ffe9 (diff)
Fix LoadMore in following and followers. (#3585)
Diffstat (limited to 'app/javascript/mastodon/features/followers/index.js')
-rw-r--r--app/javascript/mastodon/features/followers/index.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/javascript/mastodon/features/followers/index.js b/app/javascript/mastodon/features/followers/index.js
index ed7119cda..5120a5747 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>