From 12785d41b23c7b9226148c92aa3c498f5456887d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-=C3=89tienne=20Lord?= <7397743+pelord@users.noreply.github.com> Date: Thu, 27 Dec 2018 10:41:16 -0500 Subject: [PATCH] fix(layer-list): wrong keyword was used. (#253) --- .../geo/src/lib/layer/layer-list/layer-list.component.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/projects/geo/src/lib/layer/layer-list/layer-list.component.ts b/projects/geo/src/lib/layer/layer-list/layer-list.component.ts index 08f3f568c8..f76f8dc473 100644 --- a/projects/geo/src/lib/layer/layer-list/layer-list.component.ts +++ b/projects/geo/src/lib/layer/layer-list/layer-list.component.ts @@ -199,12 +199,13 @@ export class LayerListComponent implements AfterViewInit { localLayerKeywords.push(kw.normalize('NFD').replace(/[\u0300-\u036f]/g, '')); }); } - if (this.keyword) { - const localKeyword = this.keyword.normalize('NFD').replace(/[\u0300-\u036f]/g, ''); + if (this.layerListService.getKeyword()) { + const localKeyword = this.layerListService.getKeyword().normalize('NFD').replace(/[\u0300-\u036f]/g, ''); const localLayerTitle = layer.title.normalize('NFD').replace(/[\u0300-\u036f]/g, ''); if ( !new RegExp(localKeyword, 'gi').test(localLayerTitle) && - !(this.keyword.toLowerCase() === layer.dataSource.options.type.toString().toLowerCase()) && + !(this.layerListService.getKeyword() + .toLowerCase() === layer.dataSource.options.type.toString().toLowerCase()) && localLayerKeywords.filter(kw => new RegExp(localKeyword, 'gi').test(kw)).length === 0) { const index = layerIDToKeep.indexOf(layer.id); if (index > -1) {