From f80c2496848a6e155eb990988fbfc25fb175860e Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 27 Feb 2022 07:37:07 +0100 Subject: [PATCH] [Glitch] Fix not showing loading indicator when searching in web UI Port 45341c5287ea56a158284c6b5878b266ef3e2d81 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/features/explore/results.js | 2 +- app/javascript/flavours/glitch/reducers/search.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/javascript/flavours/glitch/features/explore/results.js b/app/javascript/flavours/glitch/features/explore/results.js index f035ad117d..15a850f84d 100644 --- a/app/javascript/flavours/glitch/features/explore/results.js +++ b/app/javascript/flavours/glitch/features/explore/results.js @@ -104,7 +104,7 @@ class Results extends React.PureComponent {
- {isLoading ? () : filteredResults} + {isLoading ? : filteredResults}
); diff --git a/app/javascript/flavours/glitch/reducers/search.js b/app/javascript/flavours/glitch/reducers/search.js index 152a253b39..4b8913e967 100644 --- a/app/javascript/flavours/glitch/reducers/search.js +++ b/app/javascript/flavours/glitch/reducers/search.js @@ -41,7 +41,10 @@ export default function search(state = initialState, action) { case COMPOSE_DIRECT: return state.set('hidden', true); case SEARCH_FETCH_REQUEST: - return state.set('isLoading', true); + return state.withMutations(map => { + map.set('isLoading', true); + map.set('submitted', true); + }); case SEARCH_FETCH_FAIL: return state.set('isLoading', false); case SEARCH_FETCH_SUCCESS: @@ -52,7 +55,6 @@ export default function search(state = initialState, action) { hashtags: fromJS(action.results.hashtags), })); - map.set('submitted', true); map.set('searchTerm', action.searchTerm); map.set('isLoading', false); });