Reset filters

This commit is contained in:
Nicolas Mowen 2024-09-11 08:27:22 -06:00
parent 0c09ad63d9
commit f96edc7fa4

View File

@ -796,8 +796,8 @@ export function SubFilterContent({
} }
type SearchTypeButtonProps = { type SearchTypeButtonProps = {
selectedSearchSources: SearchSource[]; selectedSearchSources: SearchSource[] | undefined;
updateSearchSourceFilter: (sources: SearchSource[]) => void; updateSearchSourceFilter: (sources: SearchSource[] | undefined) => void;
}; };
function SearchTypeButton({ function SearchTypeButton({
selectedSearchSources, selectedSearchSources,
@ -879,8 +879,8 @@ function SearchTypeButton({
} }
type SearchTypeContentProps = { type SearchTypeContentProps = {
selectedSearchSources: SearchSource[]; selectedSearchSources: SearchSource[] | undefined;
updateSearchSourceFilter: (sources: SearchSource[]) => void; updateSearchSourceFilter: (sources: SearchSource[] | undefined) => void;
onClose: () => void; onClose: () => void;
}; };
export function SearchTypeContent({ export function SearchTypeContent({
@ -889,7 +889,7 @@ export function SearchTypeContent({
onClose, onClose,
}: SearchTypeContentProps) { }: SearchTypeContentProps) {
const [currentSearchSources, setCurrentSearchSources] = useState< const [currentSearchSources, setCurrentSearchSources] = useState<
SearchSource[] SearchSource[] | undefined
>(selectedSearchSources); >(selectedSearchSources);
return ( return (
@ -953,14 +953,8 @@ export function SearchTypeContent({
</Button> </Button>
<Button <Button
onClick={() => { onClick={() => {
updateSearchSourceFilter([ updateSearchSourceFilter(undefined);
"thumbnail", setCurrentSearchSources(undefined);
"description",
] as SearchSource[]);
setCurrentSearchSources([
"thumbnail",
"description",
] as SearchSource[]);
}} }}
> >
Reset Reset