]> source.dussan.org Git - sonarqube.git/commitdiff
do not reload analyses list when component tags change
authorStas Vilchik <stas.vilchik@sonarsource.com>
Tue, 8 May 2018 09:08:43 +0000 (11:08 +0200)
committerSonarTech <sonartech@sonarsource.com>
Wed, 9 May 2018 18:20:47 +0000 (20:20 +0200)
server/sonar-web/src/main/js/apps/overview/events/AnalysesList.tsx

index d405662ace4fa963aa00bf6735d5f63d2fa2fe7d..dc59bbb836500c2c940528c35be3b7411c2f7705 100644 (file)
@@ -25,7 +25,7 @@ import PreviewGraph from '../../../components/preview-graph/PreviewGraph';
 import { translate } from '../../../helpers/l10n';
 import { Metric, Component, BranchLike } from '../../../app/types';
 import { History } from '../../../api/time-machine';
-import { getBranchLikeQuery } from '../../../helpers/branches';
+import { getBranchLikeQuery, isSameBranchLike } from '../../../helpers/branches';
 import { getActivityUrl } from '../../../helpers/urls';
 
 interface Props {
@@ -53,7 +53,10 @@ export default class AnalysesList extends React.PureComponent<Props, State> {
   }
 
   componentDidUpdate(prevProps: Props) {
-    if (prevProps.component !== this.props.component) {
+    if (
+      prevProps.component.key !== this.props.component.key ||
+      !isSameBranchLike(prevProps.branchLike, this.props.branchLike)
+    ) {
       this.fetchData();
     }
   }