diff --git a/client/src/components/Apps/AppGrid/AppGrid.tsx b/client/src/components/Apps/AppGrid/AppGrid.tsx index 481b901..079d84d 100644 --- a/client/src/components/Apps/AppGrid/AppGrid.tsx +++ b/client/src/components/Apps/AppGrid/AppGrid.tsx @@ -15,15 +15,15 @@ const AppGrid = (props: ComponentProps): JSX.Element => { let apps: JSX.Element; if (props.categories.length > 0) { - apps = ( -
@@ -33,11 +33,20 @@ const AppGrid = (props: ComponentProps): JSX.Element => { } else { apps = (
- There are no pinned application categories. You can pin them from the{' '} + You don't have any applications. You can add a new one from the{' '} /applications menu
); } + } + } else { + if (props.totalCategories) { + apps = ( ++ There are no pinned application categories. You can pin them from the{' '} + /applications menu +
+ ); } else { apps = (diff --git a/client/src/components/Home/Home.tsx b/client/src/components/Home/Home.tsx index a3ee9b4..fc15472 100644 --- a/client/src/components/Home/Home.tsx +++ b/client/src/components/Home/Home.tsx @@ -101,14 +101,14 @@ const Home = (props: ComponentProps): JSX.Element => { const searchInCategories = (query: string, categoriesToSearch: Category[]): Category[] => { const category: Category = { name: "Search Results", - type: categoriesToSearch[0].type, + type: categoriesToSearch[0]?.type, isPinned: true, apps: categoriesToSearch - .map((c: Category) => c.apps) + .map((c: Category) => c.id >= 0 ? c.apps : apps.filter((app: App) => app.categoryId === c.id)) .flat() .filter((app: App) => new RegExp(query, 'i').test(app.name)), bookmarks: categoriesToSearch - .map((c: Category) => c.bookmarks) + .map((c: Category) => c.id >= 0 ? c.bookmarks : bookmarks.filter((bookmark: Bookmark) => bookmark.categoryId === c.id)) .flat() .filter((bookmark: Bookmark) => new RegExp(query, 'i').test(bookmark.name)), id: 0,