fix(search): add mods source filter fn
All checks were successful
Release to Staging / build_and_release (push) Successful in 41s
All checks were successful
Release to Staging / build_and_release (push) Successful in 41s
Closes #77
This commit is contained in:
parent
f2f80a36c6
commit
6e4fa104c0
@ -337,8 +337,15 @@ const ModsResult = ({
|
||||
tag.toLowerCase().includes(lowerCaseSearchTerm)
|
||||
) > -1
|
||||
|
||||
return mods.filter(filterFn)
|
||||
}, [mods, searchTerm])
|
||||
const filterSourceFn = (mod: ModDetails) => {
|
||||
if (filterOptions.source === window.location.host) {
|
||||
return mod.rTag === filterOptions.source
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
return mods.filter(filterFn).filter(filterSourceFn)
|
||||
}, [filterOptions.source, mods, searchTerm])
|
||||
|
||||
const filteredModList = useFilteredMods(
|
||||
filteredMods,
|
||||
|
Loading…
Reference in New Issue
Block a user