]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Fix not showing loading indicator when searching in web UI
authorEugen Rochko <eugen@zeonfederated.com>
Sun, 27 Feb 2022 06:37:07 +0000 (07:37 +0100)
committeraescling <aescling+gitlab@cat.family>
Thu, 17 Nov 2022 05:28:24 +0000 (00:28 -0500)
Port cb2e198d89dfb86a81fff8e11eac531b658e9ef2 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
app/javascript/flavours/glitch/features/explore/results.js
app/javascript/flavours/glitch/reducers/search.js

index f035ad117d91c866f9a70081a0c056bf883ae07d..15a850f84df355160035070dcc73f3ea408dae24 100644 (file)
@@ -104,7 +104,7 @@ class Results extends React.PureComponent {
         </div>
 
         <div className='explore__search-results'>
-          {isLoading ? (<LoadingIndicator />) : filteredResults}
+          {isLoading ? <LoadingIndicator /> : filteredResults}
         </div>
       </React.Fragment>
     );
index 152a253b392dc1b38bf79427be08b9d0b054955d..4b8913e967f68cdb01a0209a809afabd4290d345 100644 (file)
@@ -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);
     });