From 4da2d4fc6acd9e6627e3cf75beab3f490ab22067 Mon Sep 17 00:00:00 2001 From: Thomas Trompette Date: Tue, 1 Oct 2024 15:33:42 +0200 Subject: [PATCH] Use active objectmetadataItems --- .../favorites/components/WorkspaceFavorites.tsx | 2 +- .../useObjectMetadataItemsInWorkspaceFavorites.ts | 11 ++++++----- .../components/NavigationDrawerOpenedSection.tsx | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/twenty-front/src/modules/favorites/components/WorkspaceFavorites.tsx b/packages/twenty-front/src/modules/favorites/components/WorkspaceFavorites.tsx index 376ba660e63a..931eae9f03f4 100644 --- a/packages/twenty-front/src/modules/favorites/components/WorkspaceFavorites.tsx +++ b/packages/twenty-front/src/modules/favorites/components/WorkspaceFavorites.tsx @@ -9,7 +9,7 @@ import { View } from '@/views/types/View'; export const WorkspaceFavorites = () => { const { records: views } = usePrefetchedData(PrefetchKey.AllViews); - const { objectMetadataItems: objectMetadataItemsToDisplay } = + const { activeObjectMetadataItems: objectMetadataItemsToDisplay } = useObjectMetadataItemsInWorkspaceFavorites(); const loading = useIsPrefetchLoading(); diff --git a/packages/twenty-front/src/modules/navigation/hooks/useObjectMetadataItemsInWorkspaceFavorites.ts b/packages/twenty-front/src/modules/navigation/hooks/useObjectMetadataItemsInWorkspaceFavorites.ts index 2ca35b974167..4e9576e58139 100644 --- a/packages/twenty-front/src/modules/navigation/hooks/useObjectMetadataItemsInWorkspaceFavorites.ts +++ b/packages/twenty-front/src/modules/navigation/hooks/useObjectMetadataItemsInWorkspaceFavorites.ts @@ -22,13 +22,14 @@ export const useObjectMetadataItemsInWorkspaceFavorites = () => { }, []), ); - const { objectMetadataItems } = useFilteredObjectMetadataItems(); + const { activeObjectMetadataItems } = useFilteredObjectMetadataItems(); - const objectMetadataItemsInWorkspaceFavorites = objectMetadataItems.filter( - (item) => favoriteViewObjectMetadataIds.has(item.id), - ); + const activeObjectMetadataItemsInWorkspaceFavorites = + activeObjectMetadataItems.filter((item) => + favoriteViewObjectMetadataIds.has(item.id), + ); return { - objectMetadataItems: objectMetadataItemsInWorkspaceFavorites, + activeObjectMetadataItems: activeObjectMetadataItemsInWorkspaceFavorites, }; }; diff --git a/packages/twenty-front/src/modules/object-metadata/components/NavigationDrawerOpenedSection.tsx b/packages/twenty-front/src/modules/object-metadata/components/NavigationDrawerOpenedSection.tsx index 4420edb31eb0..bed9adaefe82 100644 --- a/packages/twenty-front/src/modules/object-metadata/components/NavigationDrawerOpenedSection.tsx +++ b/packages/twenty-front/src/modules/object-metadata/components/NavigationDrawerOpenedSection.tsx @@ -26,7 +26,7 @@ export const NavigationDrawerOpenedSection = () => { const currentPath = useLocation().pathname; const currentObjectNamePlural = extractObjectFromCurrentPath(currentPath); - const { objectMetadataItems: objectMetadataItemsCurrentlyDisplayed } = + const { activeObjectMetadataItems: objectMetadataItemsCurrentlyDisplayed } = useObjectMetadataItemsInWorkspaceFavorites(); if (!currentObjectNamePlural) {