From 496924b2a49c0ce6b61e681504f656bff0b9b1e4 Mon Sep 17 00:00:00 2001 From: Chubby Granny Chaser Date: Sun, 22 Dec 2024 23:42:49 +0000 Subject: [PATCH] fix: fixing download sources migration --- .../src/pages/catalogue/catalogue.tsx | 24 +++++++++++-------- .../src/pages/catalogue/filter-section.tsx | 10 ++++---- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/renderer/src/pages/catalogue/catalogue.tsx b/src/renderer/src/pages/catalogue/catalogue.tsx index e5787ea8..e85e94b5 100644 --- a/src/renderer/src/pages/catalogue/catalogue.tsx +++ b/src/renderer/src/pages/catalogue/catalogue.tsx @@ -403,23 +403,27 @@ export default function Catalogue() { color={filterCategoryColors.tags} onClear={() => dispatch(setSearch({ tags: [] }))} onSelect={(value) => { - if (filters.tags.includes(value)) { + if (filters.tags.includes(Number(value))) { dispatch( setSearch({ - tags: filters.tags.filter((tag) => tag !== value), + tags: filters.tags.filter((tag) => tag !== Number(value)), }) ); } else { - dispatch(setSearch({ tags: [...filters.tags, value] })); + dispatch( + setSearch({ tags: [...filters.tags, Number(value)] }) + ); } }} - items={Object.entries(steamUserTags) - .sort(([keyA], [keyB]) => keyA.localeCompare(keyB)) - .map(([key, value]) => ({ - label: key, - value: value, - checked: filters.tags.includes(value), - }))} + items={ + Object.entries(steamUserTags) + .sort(([keyA], [keyB]) => keyA.localeCompare(keyB)) + .map(([key, value]) => ({ + label: key, + value: value, + checked: filters.tags.includes(value as number), + })) as any + } /> { +export interface FilterSectionProps { title: string; items: { label: string; - value: T; + value: string; checked: boolean; }[]; - onSelect: (value: T) => void; + onSelect: (value: string) => void; color: string; onClear: () => void; } -export function FilterSection({ +export function FilterSection({ title, items, color, onSelect, onClear, -}: FilterSectionProps) { +}: FilterSectionProps) { const [search, setSearch] = useState(""); const filteredItems = useMemo(() => {