Skip to content

Commit

Permalink
Use active objectmetadataItems
Browse files Browse the repository at this point in the history
  • Loading branch information
thomtrp committed Oct 1, 2024
1 parent d8e4960 commit 4da2d4f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { View } from '@/views/types/View';
export const WorkspaceFavorites = () => {
const { records: views } = usePrefetchedData<View>(PrefetchKey.AllViews);

const { objectMetadataItems: objectMetadataItemsToDisplay } =
const { activeObjectMetadataItems: objectMetadataItemsToDisplay } =
useObjectMetadataItemsInWorkspaceFavorites();

const loading = useIsPrefetchLoading();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const NavigationDrawerOpenedSection = () => {
const currentPath = useLocation().pathname;
const currentObjectNamePlural = extractObjectFromCurrentPath(currentPath);

const { objectMetadataItems: objectMetadataItemsCurrentlyDisplayed } =
const { activeObjectMetadataItems: objectMetadataItemsCurrentlyDisplayed } =
useObjectMetadataItemsInWorkspaceFavorites();

if (!currentObjectNamePlural) {
Expand Down

0 comments on commit 4da2d4f

Please sign in to comment.