From 0455dfbef6716c1cbaef5900073b663add66188e Mon Sep 17 00:00:00 2001 From: Jean-Pascal MILCENT Date: Thu, 24 Feb 2022 12:01:39 +0100 Subject: [PATCH] Fix frontend/synthese-advanced: dynamic tree now avalaible in ngOnInit --- .../advanced-form/synthese-advanced-form-component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/GN2CommonModule/form/synthese-form/advanced-form/synthese-advanced-form-component.ts b/frontend/src/app/GN2CommonModule/form/synthese-form/advanced-form/synthese-advanced-form-component.ts index 8b2ac0868f..809a54807d 100644 --- a/frontend/src/app/GN2CommonModule/form/synthese-form/advanced-form/synthese-advanced-form-component.ts +++ b/frontend/src/app/GN2CommonModule/form/synthese-form/advanced-form/synthese-advanced-form-component.ts @@ -17,7 +17,7 @@ import { TaxonAdvancedStoreService } from '@geonature_common/form/synthese-form/ styleUrls: ['./synthese-advanced-form.component.scss'] }) export class TaxonAdvancedModalComponent implements OnInit, AfterContentInit { - @ViewChild('tree', { static: false }) + @ViewChild('tree', { static: true }) public treeComponent: TreeComponent; public URL_AUTOCOMPLETE; public taxonsTree; @@ -59,7 +59,7 @@ export class TaxonAdvancedModalComponent implements OnInit, AfterContentInit { ngOnInit() { // if the modal has already been open, reload the former state of the taxon tree - if (this.storeService.taxonTreeState) { + if (this.storeService.displayTaxonTree && this.storeService.taxonTreeState) { this.storeService.treeModel.setState(this.storeService.taxonTreeState); } }