diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2022-02-27 07:37:07 +0100 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2022-10-08 20:49:02 +0200 |
commit | 6e208a817d92df3606b7e5a9b153ddc5a4d180b4 (patch) | |
tree | 39a17c9cbed8aa1a232f844efa9cf3149e83e723 /app | |
parent | 058b74dc0a3cdf6873117ea9f48351035b365d7f (diff) |
[Glitch] Fix not showing loading indicator when searching in web UI
Port cb2e198d89dfb86a81fff8e11eac531b658e9ef2 to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Diffstat (limited to 'app')
-rw-r--r-- | app/javascript/flavours/glitch/features/explore/results.js | 2 | ||||
-rw-r--r-- | 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 f035ad117..15a850f84 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 { </div> <div className='explore__search-results'> - {isLoading ? (<LoadingIndicator />) : filteredResults} + {isLoading ? <LoadingIndicator /> : filteredResults} </div> </React.Fragment> ); diff --git a/app/javascript/flavours/glitch/reducers/search.js b/app/javascript/flavours/glitch/reducers/search.js index 152a253b3..4b8913e96 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); }); |