From: Jeremy Davis Date: Wed, 27 Sep 2023 09:04:25 +0000 (+0200) Subject: SONAR-20382 Fix flaky test - 2nd attempt X-Git-Tag: 10.3.0.82913~346 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b53eb410076e916f554f0ffe71ff0d350cde5362;p=sonarqube.git SONAR-20382 Fix flaky test - 2nd attempt --- diff --git a/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx b/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx index 6b37df5b8de..8fee8246f08 100644 --- a/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx +++ b/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx @@ -102,9 +102,12 @@ export class ComponentContainer extends React.PureComponent { } }; - 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 { }, () => { if (shouldFetchComponent) { - this.fetchComponent(shouldRedirectToDashboard, true); + this.fetchComponent(shouldRedirectToDashboard); } }, );