From ca109cbad5e8268beb6000abab5d49517e6ef4a2 Mon Sep 17 00:00:00 2001 From: Chris Hunt Date: Wed, 4 Jan 2023 09:19:51 +0000 Subject: [PATCH] Fix for searching apps when some have no category --- site/pages/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/pages/index.js b/site/pages/index.js index 99c9942..cd2b64c 100644 --- a/site/pages/index.js +++ b/site/pages/index.js @@ -19,9 +19,9 @@ export default function Home({ searchText }) { const lowerSearch = searchText && searchText.toLowerCase(); if (searchText && searchText !== "") { 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) - ); + ) : []; return ( i.name.toLowerCase().includes(lowerSearch) || category.length > 0