mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 13:34:54 +03:00
fix: fixing download sources migration
This commit is contained in:
parent
32032e1c8a
commit
496924b2a4
@ -403,23 +403,27 @@ export default function Catalogue() {
|
|||||||
color={filterCategoryColors.tags}
|
color={filterCategoryColors.tags}
|
||||||
onClear={() => dispatch(setSearch({ tags: [] }))}
|
onClear={() => dispatch(setSearch({ tags: [] }))}
|
||||||
onSelect={(value) => {
|
onSelect={(value) => {
|
||||||
if (filters.tags.includes(value)) {
|
if (filters.tags.includes(Number(value))) {
|
||||||
dispatch(
|
dispatch(
|
||||||
setSearch({
|
setSearch({
|
||||||
tags: filters.tags.filter((tag) => tag !== value),
|
tags: filters.tags.filter((tag) => tag !== Number(value)),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
dispatch(setSearch({ tags: [...filters.tags, value] }));
|
dispatch(
|
||||||
|
setSearch({ tags: [...filters.tags, Number(value)] })
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
items={Object.entries(steamUserTags)
|
items={
|
||||||
.sort(([keyA], [keyB]) => keyA.localeCompare(keyB))
|
Object.entries(steamUserTags)
|
||||||
.map(([key, value]) => ({
|
.sort(([keyA], [keyB]) => keyA.localeCompare(keyB))
|
||||||
label: key,
|
.map(([key, value]) => ({
|
||||||
value: value,
|
label: key,
|
||||||
checked: filters.tags.includes(value),
|
value: value,
|
||||||
}))}
|
checked: filters.tags.includes(value as number),
|
||||||
|
})) as any
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<FilterSection
|
<FilterSection
|
||||||
|
@ -4,25 +4,25 @@ import { useCallback, useMemo, useState } from "react";
|
|||||||
|
|
||||||
import List from "rc-virtual-list";
|
import List from "rc-virtual-list";
|
||||||
|
|
||||||
export interface FilterSectionProps<T extends string | number> {
|
export interface FilterSectionProps {
|
||||||
title: string;
|
title: string;
|
||||||
items: {
|
items: {
|
||||||
label: string;
|
label: string;
|
||||||
value: T;
|
value: string;
|
||||||
checked: boolean;
|
checked: boolean;
|
||||||
}[];
|
}[];
|
||||||
onSelect: (value: T) => void;
|
onSelect: (value: string) => void;
|
||||||
color: string;
|
color: string;
|
||||||
onClear: () => void;
|
onClear: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function FilterSection<T extends string | number>({
|
export function FilterSection({
|
||||||
title,
|
title,
|
||||||
items,
|
items,
|
||||||
color,
|
color,
|
||||||
onSelect,
|
onSelect,
|
||||||
onClear,
|
onClear,
|
||||||
}: FilterSectionProps<T>) {
|
}: FilterSectionProps) {
|
||||||
const [search, setSearch] = useState("");
|
const [search, setSearch] = useState("");
|
||||||
|
|
||||||
const filteredItems = useMemo(() => {
|
const filteredItems = useMemo(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user