1
0
Fork 0
mirror of synced 2024-09-10 22:46:09 +12:00

Fix buttons being highlighted when filters are set

This commit is contained in:
Andrew Kingston 2023-03-07 11:43:42 +00:00
parent ca92d520b3
commit 554659bd91
3 changed files with 5 additions and 5 deletions

View file

@ -2,11 +2,11 @@
import CreateColumnButton from "../CreateColumnButton.svelte"
import { getContext, onMount } from "svelte"
const { rows, columns, subscribe } = getContext("sheet")
const { rows, columns, subscribe, filter } = getContext("sheet")
let createColumnModal
$: highlighted = !$rows.length || !$columns.length
$: highlighted = !$filter.length && (!$rows.length || !$columns.length)
onMount(() => subscribe("add-column", createColumnModal.show))
</script>

View file

@ -3,10 +3,10 @@
import CreateEditRow from "../../modals/CreateEditRow.svelte"
import { getContext } from "svelte"
const { rows, columns } = getContext("sheet")
const { rows, columns, filter } = getContext("sheet")
$: hasCols = !!$columns.length
$: hasRows = !!$rows.length
$: hasRows = $rows.length || $filter.length
</script>
<CreateRowButton

View file

@ -5,7 +5,7 @@
const { columns, config, filter, schema } = getContext("sheet")
const onFilter = e => {
filter.set(e.detail)
filter.set(e.detail || [])
}
</script>