[Glitch] Fix “load more” button when no data has been fetched
This commit is contained in:
		
							parent
							
								
									2d097c10d0
								
							
						
					
					
						commit
						1e656c3632
					
				| 
						 | 
					@ -55,7 +55,7 @@ export default class StatusList extends ImmutablePureComponent {
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  handleLoadOlder = debounce(() => {
 | 
					  handleLoadOlder = debounce(() => {
 | 
				
			||||||
    this.props.onLoadMore(this.props.statusIds.last());
 | 
					    this.props.onLoadMore(this.props.statusIds.size > 0 ? this.props.statusIds.last() : undefined);
 | 
				
			||||||
  }, 300, { leading: true })
 | 
					  }, 300, { leading: true })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  _selectChild (index) {
 | 
					  _selectChild (index) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -67,7 +67,7 @@ export default class AccountGallery extends ImmutablePureComponent {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  handleScrollToBottom = () => {
 | 
					  handleScrollToBottom = () => {
 | 
				
			||||||
    if (this.props.hasMore) {
 | 
					    if (this.props.hasMore) {
 | 
				
			||||||
      this.handleLoadMore(this.props.medias.last().getIn(['status', 'id']));
 | 
					      this.handleLoadMore(this.props.medias.size > 0 ? this.props.medias.last().getIn(['status', 'id']) : undefined);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue