From 461c567ab84d221306bc0bd5405b2e4fd2533305 Mon Sep 17 00:00:00 2001
From: Xiao Gui <xgui3783@gmail.com>
Date: Mon, 19 Nov 2018 11:57:49 +0100
Subject: [PATCH] bugfix: fixing onhoversegment context menu always show

---
 src/atlasViewer/atlasViewer.component.ts  | 6 +++---
 src/atlasViewer/atlasViewer.template.html | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/atlasViewer/atlasViewer.component.ts b/src/atlasViewer/atlasViewer.component.ts
index f455d1ccd..9d888e533 100644
--- a/src/atlasViewer/atlasViewer.component.ts
+++ b/src/atlasViewer/atlasViewer.component.ts
@@ -165,13 +165,13 @@ export class AtlasViewer implements OnDestroy, OnInit, AfterViewInit {
             state.mouseOverSegment.constructor === Number ?
               state.mouseOverSegment.toString() :
               state.mouseOverSegment.name :
-            '' :
-          ''),
+            null :
+          null),
         distinctUntilChanged()
       ),
       this.onhoverLandmark$
     ).pipe(
-      map(([segment, onhoverLandmark]) => onhoverLandmark ? '' : segment )
+      map(([segment, onhoverLandmark]) => onhoverLandmark ? null : segment )
     )
 
   }
diff --git a/src/atlasViewer/atlasViewer.template.html b/src/atlasViewer/atlasViewer.template.html
index 0e5250ccd..c5224690f 100644
--- a/src/atlasViewer/atlasViewer.template.html
+++ b/src/atlasViewer/atlasViewer.template.html
@@ -158,9 +158,9 @@
         {{ onhoverLandmark$ | async }} <i><small class = "mute-text">{{ toggleMessage }}</small></i>
       </div>
       <div 
-        *ngIf = "(onhoverSegment$ | async) !== ''" 
+        *ngIf = "onhoverSegment$ | async as onhoverSegment " 
         contextualBlock>
-        {{ onhoverSegment$ | async }} <i><small class = "mute-text">{{ toggleMessage }}</small></i>
+        {{ onhoverSegment }} <i><small class = "mute-text">{{ toggleMessage }}</small></i>
       </div>
       <!-- TODO Potentially implementing plugin contextual info -->
     </div>
-- 
GitLab