1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00

Fix crash when expanding search results for hashtags (#11447)

This commit is contained in:
ThibG 2019-07-30 12:06:21 +02:00 committed by Eugen Rochko
parent 24552b5160
commit 78144f4c79

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;
}