]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-20382 Fix flaky test - 2nd attempt
authorJeremy Davis <jeremy.davis@sonarsource.com>
Wed, 27 Sep 2023 09:04:25 +0000 (11:04 +0200)
committersonartech <sonartech@sonarsource.com>
Wed, 27 Sep 2023 20:02:58 +0000 (20:02 +0000)
server/sonar-web/src/main/js/app/components/ComponentContainer.tsx

index 6b37df5b8de47ac797e2f3f3559a2b75313cab2a..8fee8246f08efc87fd71d5a1e1fdef2ed6c03bcb 100644 (file)
@@ -102,9 +102,12 @@ export class ComponentContainer extends React.PureComponent<Props, State> {
     }
   };
 
-  fetchComponent = async (shouldRedirectToDashboard = false, backgroundLoading = false) => {
+  fetchComponent = async (shouldRedirectToDashboard = false) => {
     const { branch, id: key, pullRequest } = this.props.location.query;
-    if (!backgroundLoading) {
+    const { component } = this.state;
+
+    // Only show loader if we're changing components
+    if (component?.key !== key) {
       this.setState({ loading: true });
     }
 
@@ -191,7 +194,7 @@ export class ComponentContainer extends React.PureComponent<Props, State> {
             },
             () => {
               if (shouldFetchComponent) {
-                this.fetchComponent(shouldRedirectToDashboard, true);
+                this.fetchComponent(shouldRedirectToDashboard);
               }
             },
           );