Fix for searching apps when some have no category
This commit is contained in:
parent
46c19fedca
commit
ca109cbad5
@ -19,9 +19,9 @@ export default function Home({ searchText }) {
|
|||||||
const lowerSearch = searchText && searchText.toLowerCase();
|
const lowerSearch = searchText && searchText.toLowerCase();
|
||||||
if (searchText && searchText !== "") {
|
if (searchText && searchText !== "") {
|
||||||
filteredapps = filteredapps.filter((i) => {
|
filteredapps = filteredapps.filter((i) => {
|
||||||
const category = i.categories.filter((i) =>
|
const category = (i.categories && i.categories.length > 0) ? i.categories.filter((i) =>
|
||||||
i.toLowerCase().includes(lowerSearch)
|
i.toLowerCase().includes(lowerSearch)
|
||||||
);
|
) : [];
|
||||||
return (
|
return (
|
||||||
i.name.toLowerCase().includes(lowerSearch) ||
|
i.name.toLowerCase().includes(lowerSearch) ||
|
||||||
category.length > 0
|
category.length > 0
|
||||||
|
Loading…
Reference in New Issue
Block a user