diff options
author | ThibG <thib@sitedethib.com> | 2019-07-30 12:06:21 +0200 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2019-07-30 12:31:02 +0200 |
commit | d8097ecd2f787aa0a065a753146151074eef55c6 (patch) | |
tree | 16896fc6f86c006ed6aba93db23cdec84c11bee3 | |
parent | 24968d20a07d483cd36b4747bd1db8bd512002c2 (diff) |
[Glitch] Fix crash when expanding search results for hashtags
Port 78144f4c7923d502cc86b322f044e740e4a8fa8a to glitch-soc
-rw-r--r-- | app/javascript/flavours/glitch/reducers/search.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/reducers/search.js b/app/javascript/flavours/glitch/reducers/search.js index f4d99a99a..c346e958b 100644 --- a/app/javascript/flavours/glitch/reducers/search.js +++ b/app/javascript/flavours/glitch/reducers/search.js @@ -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; } |