fix(CategoryFilter): fix toggle behavior

This commit is contained in:
Ilia Mashkov
2026-01-02 17:19:53 +03:00
parent 4ba02b5933
commit 90899c0b3b
2 changed files with 2 additions and 2 deletions

View File

@@ -5,7 +5,7 @@ import { categoryFilterStore } from '../store/categoryFilterStore';
const { categories } = $derived($categoryFilterStore);
function didCategoryToggle(categoryId: string) {
if (categories?.find(category => category.id === categoryId)) {
if (categories?.find(category => category.id === categoryId)?.selected) {
categoryFilterStore.deselectCategory(categoryId);
} else {
categoryFilterStore.selectCategory(categoryId);