mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix: filters logic
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
InputDateTime
|
||||
} from '$lib/elements/forms';
|
||||
import { createEventDispatcher, onMount } from 'svelte';
|
||||
import { tags, operators, addFilter } from './store';
|
||||
import { tags, operators, addFilter, queries } from './store';
|
||||
import type { Column } from '$lib/helpers/types';
|
||||
import type { Writable } from 'svelte/store';
|
||||
import { TagList } from '.';
|
||||
@@ -55,6 +55,9 @@
|
||||
operatorKey = null;
|
||||
value = null;
|
||||
arrayValues = [];
|
||||
if (singleCondition) {
|
||||
queries.apply();
|
||||
}
|
||||
}
|
||||
|
||||
const dispatch = createEventDispatcher<{
|
||||
|
||||
@@ -50,6 +50,18 @@
|
||||
queries.apply();
|
||||
}
|
||||
|
||||
function afterApply(
|
||||
e: CustomEvent<{
|
||||
applied: number;
|
||||
}>
|
||||
) {
|
||||
applied = e.detail.applied;
|
||||
if (singleCondition) {
|
||||
showFiltersDesktop = false;
|
||||
showFiltersMobile = false;
|
||||
}
|
||||
}
|
||||
|
||||
$: if (!showFiltersDesktop && !showFiltersMobile) {
|
||||
selectedColumn = null;
|
||||
value = null;
|
||||
@@ -92,7 +104,7 @@
|
||||
bind:arrayValues
|
||||
{columns}
|
||||
{singleCondition}
|
||||
on:apply={(e) => (applied = e.detail.applied)}
|
||||
on:apply={afterApply}
|
||||
on:clear={() => (applied = 0)} />
|
||||
<hr />
|
||||
<div class="u-flex u-margin-block-start-16 u-main-end u-gap-8">
|
||||
@@ -136,7 +148,7 @@
|
||||
bind:value
|
||||
bind:arrayValues
|
||||
{singleCondition}
|
||||
on:apply={(e) => (applied = e.detail.applied)}
|
||||
on:apply={afterApply}
|
||||
on:clear={() => (applied = 0)} />
|
||||
<svelte:fragment slot="footer">
|
||||
{#if singleCondition}
|
||||
|
||||
Reference in New Issue
Block a user