From 35b49439489f4d3eaa94ec6df58ceebd602a4658 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Mon, 21 Oct 2024 23:29:56 +0200 Subject: [PATCH] UI: hide 'active filters' and 'filter results' if the filter view is disabled --- src/UI/Search/SearchResults.svelte | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/UI/Search/SearchResults.svelte b/src/UI/Search/SearchResults.svelte index f184c348e..e725a083c 100644 --- a/src/UI/Search/SearchResults.svelte +++ b/src/UI/Search/SearchResults.svelte @@ -18,7 +18,7 @@ .filter( (f) => f.filter.options[0].fields.length === 0 && - Constants.priviliged_layers.indexOf(f.layer.id) < 0 + Constants.priviliged_layers.indexOf(f.layer.id) < 0, ) .map((af) => { const index = af.control.data @@ -28,15 +28,18 @@ option: af.filter.options[index], } return r - }) + }), ) - let allowOtherThemes = state.featureSwitches.featureSwitchBackToThemeOverview let searchTerm = state.searchState.searchTerm + + let allowOtherThemes = state.featureSwitches.featureSwitchBackToThemeOverview + let allowFilters = state.featureSwitches.featureSwitchFilter
- - + {#if $allowFilters} + + {/if} {#if $searchTerm.length === 0 && $activeFilters.length === 0}
@@ -45,8 +48,9 @@
{/if} - - + {#if $allowFilters} + + {/if} {#if $allowOtherThemes}