about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/reducers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-07-27 05:49:50 +0200
committerThibaut Girka <thib@sitedethib.com>2019-07-28 17:10:52 +0200
commit51411267fda00db576230a270a10e31992378c18 (patch)
treee781d40b53cc824cd22f722cc103fc8ec84351ce /app/javascript/flavours/glitch/reducers
parent7f147acea61f1f37928f38eef507b34c98e003fd (diff)
[Glitch] Add search results pagination to web UI (#11409)
Port 8a4674f2c3d89c998eb5438b96b7977dc2be3167 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/reducers')
-rw-r--r--app/javascript/flavours/glitch/reducers/search.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/reducers/search.js b/app/javascript/flavours/glitch/reducers/search.js
index 1c32a5b9f..f4d99a99a 100644
--- a/app/javascript/flavours/glitch/reducers/search.js
+++ b/app/javascript/flavours/glitch/reducers/search.js
@@ -3,6 +3,7 @@ import {
   SEARCH_CLEAR,
   SEARCH_FETCH_SUCCESS,
   SEARCH_SHOW,
+  SEARCH_EXPAND_SUCCESS,
 } from 'flavours/glitch/actions/search';
 import {
   COMPOSE_MENTION,
@@ -42,6 +43,8 @@ export default function search(state = initialState, action) {
       statuses: ImmutableList(action.results.statuses.map(item => item.id)),
       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)));
   default:
     return state;
   }