From 1dde040f20c60f9c81d639b7a638c3203e1f3118 Mon Sep 17 00:00:00 2001
From: xgui3783 <xgui3783@gmail.com>
Date: Tue, 25 Aug 2020 14:29:42 +0200
Subject: [PATCH] chore: hide layer icon if not available (#645)

---
 src/ui/atlasLayerSelector/atlasLayerSelector.component.ts  | 2 +-
 src/ui/atlasLayerSelector/atlasLayerSelector.template.html | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/ui/atlasLayerSelector/atlasLayerSelector.component.ts b/src/ui/atlasLayerSelector/atlasLayerSelector.component.ts
index 822ed15ed..d103ef97f 100644
--- a/src/ui/atlasLayerSelector/atlasLayerSelector.component.ts
+++ b/src/ui/atlasLayerSelector/atlasLayerSelector.component.ts
@@ -5,7 +5,7 @@ import { distinctUntilChanged, map, withLatestFrom, shareReplay, groupBy, mergeM
 import { Observable, Subscription, from, zip, of, combineLatest } from "rxjs";
 import { viewerStateSelectTemplateWithId, viewerStateToggleLayer } from "src/services/state/viewerState.store.helper";
 import { MatMenuTrigger } from "@angular/material/menu";
-import { viewerStateGetSelectedAtlas, viewerStateAtlasParcellationSelector, viewerStateAtlasLatestParcellationSelector } from "src/services/state/viewerState/selectors";
+import { viewerStateGetSelectedAtlas, viewerStateAtlasLatestParcellationSelector } from "src/services/state/viewerState/selectors";
 import {CLEAR_CONNECTIVITY_REGION, SET_CONNECTIVITY_VISIBLE} from "src/services/state/viewerState.store";
 
 @Component({
diff --git a/src/ui/atlasLayerSelector/atlasLayerSelector.template.html b/src/ui/atlasLayerSelector/atlasLayerSelector.template.html
index 2f68eaf02..fa3219cf9 100644
--- a/src/ui/atlasLayerSelector/atlasLayerSelector.template.html
+++ b/src/ui/atlasLayerSelector/atlasLayerSelector.template.html
@@ -64,6 +64,7 @@
         <button color="primary"
                 matTooltip="Select layer"
                 mat-mini-fab
+                *ngIf="((availableTemplates$ | async).length > 1) || ((groupedLayers$ | async).length + (nonGroupedLayers$ | async).length > 1)"
                 aria-label="Layer selector expand button"
                 (click)="selectorExpanded = !selectorExpanded">
             <i class="fas fa-layer-group"></i>
-- 
GitLab