[Glitch] Fix crash when expanding search results for hashtags
Port 78144f4c7923d502cc86b322f044e740e4a8fa8a to glitch-soc
This commit is contained in:
		
							parent
							
								
									24968d20a0
								
							
						
					
					
						commit
						d8097ecd2f
					
				@ -44,7 +44,8 @@ export default function search(state = initialState, action) {
 | 
				
			|||||||
      hashtags: fromJS(action.results.hashtags),
 | 
					      hashtags: fromJS(action.results.hashtags),
 | 
				
			||||||
    })).set('submitted', true).set('searchTerm', action.searchTerm);
 | 
					    })).set('submitted', true).set('searchTerm', action.searchTerm);
 | 
				
			||||||
  case SEARCH_EXPAND_SUCCESS:
 | 
					  case SEARCH_EXPAND_SUCCESS:
 | 
				
			||||||
    return state.updateIn(['results', action.searchType], list => list.concat(action.results[action.searchType].map(item => item.id)));
 | 
					    const results = action.searchType === 'hashtags' ? fromJS(action.results.hashtags) : action.results[action.searchType].map(item => item.id);
 | 
				
			||||||
 | 
					    return state.updateIn(['results', action.searchType], list => list.concat(results));
 | 
				
			||||||
  default:
 | 
					  default:
 | 
				
			||||||
    return state;
 | 
					    return state;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user