[Glitch] Fix crash when expanding search results for hashtags

Port 78144f4c79 to glitch-soc
pull/1183/head
ThibG 2019-07-30 12:06:21 +02:00 committed by Thibaut Girka
parent 24968d20a0
commit d8097ecd2f
1 changed files with 2 additions and 1 deletions

View File

@ -44,7 +44,8 @@ export default function search(state = initialState, action) {
hashtags: fromJS(action.results.hashtags),
})).set('submitted', true).set('searchTerm', action.searchTerm);
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:
return state;
}