diff --git a/packages/builder/src/components/database/DataTable/popovers/Filter.svelte b/packages/builder/src/components/database/DataTable/popovers/Filter.svelte index 8dc4c3073e..1cf8e9acab 100644 --- a/packages/builder/src/components/database/DataTable/popovers/Filter.svelte +++ b/packages/builder/src/components/database/DataTable/popovers/Filter.svelte @@ -54,26 +54,24 @@ let anchor let dropdown - $: filters = view.filters || [] $: viewModel = $backendUiStore.models.find( ({ _id }) => _id === $backendUiStore.selectedView.modelId ) $: fields = viewModel && Object.keys(viewModel.schema) function saveView() { - view.filters = filters backendUiStore.actions.views.save(view) notifier.success(`View ${view.name} saved.`) dropdown.hide() } function removeFilter(idx) { - filters.splice(idx, 1) - filters = filters + view.filters.splice(idx, 1) + view.filters = view.filters } function addFilter() { - filters = [...filters, {}] + view.filters = [...view.filters, {}] } @@ -82,7 +80,7 @@ text small on:click={dropdown.show} - active={filters && filters.length}> + active={view.filters && view.filters.length}> Filter @@ -90,7 +88,7 @@
Filter
- {#each filters as filter, idx} + {#each view.filters as filter, idx} {#if idx === 0}

Where

{:else}