Fix home timeline perpetually reloading when empty
Port 3e0ed36e8ede7f1994ab9c46c4cb86e613569440 to glitch-soc
This commit is contained in:
		
							parent
							
								
									f513317ba2
								
							
						
					
					
						commit
						cce1c3252f
					
				@ -16,7 +16,7 @@ const messages = defineMessages({
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const mapStateToProps = state => ({
 | 
					const mapStateToProps = state => ({
 | 
				
			||||||
  hasUnread: state.getIn(['timelines', 'home', 'unread']) > 0,
 | 
					  hasUnread: state.getIn(['timelines', 'home', 'unread']) > 0,
 | 
				
			||||||
  isPartial: state.getIn(['timelines', 'home', 'items', 0], null) === null,
 | 
					  isPartial: state.getIn(['timelines', 'home', 'isPartial']),
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@connect(mapStateToProps)
 | 
					@connect(mapStateToProps)
 | 
				
			||||||
 | 
				
			|||||||
@ -29,6 +29,8 @@ const initialTimeline = ImmutableMap({
 | 
				
			|||||||
const expandNormalizedTimeline = (state, timeline, statuses, next, isPartial, isLoadingRecent) => {
 | 
					const expandNormalizedTimeline = (state, timeline, statuses, next, isPartial, isLoadingRecent) => {
 | 
				
			||||||
  return state.update(timeline, initialTimeline, map => map.withMutations(mMap => {
 | 
					  return state.update(timeline, initialTimeline, map => map.withMutations(mMap => {
 | 
				
			||||||
    mMap.set('isLoading', false);
 | 
					    mMap.set('isLoading', false);
 | 
				
			||||||
 | 
					    mMap.set('isPartial', isPartial);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!next && !isLoadingRecent) mMap.set('hasMore', false);
 | 
					    if (!next && !isLoadingRecent) mMap.set('hasMore', false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!statuses.isEmpty()) {
 | 
					    if (!statuses.isEmpty()) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user