From f970b5c81f039517f35a9749298e2938de404609 Mon Sep 17 00:00:00 2001
From: Xiao Gui <xgui3783@gmail.com>
Date: Thu, 9 May 2019 09:18:50 +0200
Subject: [PATCH] bugfix: on parcellation change, region hierarchy also changes

---
 src/ui/regionHierachy/regionHierarchy.component.ts | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/ui/regionHierachy/regionHierarchy.component.ts b/src/ui/regionHierachy/regionHierarchy.component.ts
index 9fcc8df3b..382f1f407 100644
--- a/src/ui/regionHierachy/regionHierarchy.component.ts
+++ b/src/ui/regionHierachy/regionHierarchy.component.ts
@@ -75,6 +75,10 @@ export class RegionHierarchy implements OnInit, AfterViewInit{
   }
 
   ngOnChanges(){
+    this.aggregatedRegionTree = {
+      name: this.selectedParcellation.name,
+      children: this.selectedParcellation.regions
+    }
     this.displayTreeNode = getDisplayTreeNode(this.searchTerm, this.selectedRegions)
     this.filterTreeBySearch = getFilterTreeBySearch(this.filterNameBySearchPipe, this.searchTerm)
   }
@@ -94,10 +98,6 @@ export class RegionHierarchy implements OnInit, AfterViewInit{
   }
 
   ngOnInit(){
-    this.aggregatedRegionTree = {
-      name: this.selectedParcellation.name,
-      children: this.selectedParcellation.regions
-    }
 
     this.subscriptions.push(
       this.handleRegionTreeClickSubject.pipe(
-- 
GitLab