]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-10537 Homepage icon not always highlighted correctly (#86)
authorStas Vilchik <stas.vilchik@sonarsource.com>
Tue, 3 Apr 2018 07:15:41 +0000 (09:15 +0200)
committerJanos Gyerik <janos.gyerik@sonarsource.com>
Wed, 4 Apr 2018 12:40:50 +0000 (14:40 +0200)
server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMeta.tsx

index d8a16d8066eabc81526e8f6212cdb275b5e7a537..bb998f285aedeaf5d0d8d6daafa98b264fc23afe 100644 (file)
@@ -108,8 +108,8 @@ function getCurrentPage(component: Component, branchLike: BranchLike | undefined
   } else if (component.qualifier === 'APP') {
     currentPage = { type: HomePageType.Application, component: component.key };
   } else if (component.qualifier === 'TRK') {
-    const branch =
-      isMainBranch(branchLike) || isLongLivingBranch(branchLike) ? branchLike.name : undefined;
+    // when home page is set to the default branch of a project, its name is returned as `undefined`
+    const branch = isLongLivingBranch(branchLike) ? branchLike.name : undefined;
     currentPage = { type: HomePageType.Project, component: component.key, branch };
   }
   return currentPage;