]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Fix crash when expanding search results for hashtags
authorThibG <thib@sitedethib.com>
Tue, 30 Jul 2019 10:06:21 +0000 (12:06 +0200)
committerThibaut Girka <thib@sitedethib.com>
Tue, 30 Jul 2019 10:31:02 +0000 (12:31 +0200)
Port 78144f4c7923d502cc86b322f044e740e4a8fa8a to glitch-soc

app/javascript/flavours/glitch/reducers/search.js

index f4d99a99a11dbbda00f388981da505e42a40a32e..c346e958b79aa3aeb1fef9c1a6c279eab9118301 100644 (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;
   }