fix(filters): remove hardcoded fallback

This commit is contained in:
Ilia Mashkov
2026-03-02 14:53:54 +03:00
parent db7ffd3246
commit 6d06f9f877
2 changed files with 17 additions and 26 deletions

View File

@@ -1,16 +1,10 @@
import { createFilterManager } from '../../lib/filterManager/filterManager.svelte';
import {
FONT_CATEGORIES,
FONT_PROVIDERS,
FONT_SUBSETS,
} from '../const/const';
import { filtersStore } from './filters.svelte';
/**
* Creates initial filter config
*
* Uses dynamic filters from backend if available,
* otherwise falls back to hard-coded constants
* Uses dynamic filters from backend with empty state initially
*/
function createInitialConfig() {
const dynamicFilters = filtersStore.filters;
@@ -33,26 +27,10 @@ function createInitialConfig() {
};
}
// Fallback to hard-coded constants (backward compatibility)
// No filters loaded yet - return empty state
return {
queryValue: '',
groups: [
{
id: 'providers',
label: 'Font provider',
properties: FONT_PROVIDERS,
},
{
id: 'subsets',
label: 'Font subset',
properties: FONT_SUBSETS,
},
{
id: 'categories',
label: 'Font category',
properties: FONT_CATEGORIES,
},
],
groups: [],
};
}