From f5a09be1fd8ddd9931913d61611af698f73536af Mon Sep 17 00:00:00 2001 From: celine Date: Mon, 8 Dec 2025 13:57:56 -0500 Subject: [PATCH] fixed issue where archived items turned up in filtered home --- app/(home-pages)/home/HomeLayout.tsx | 10 ++++++---- app/(home-pages)/home/LeafletList/LeafletOptions.tsx | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/(home-pages)/home/HomeLayout.tsx b/app/(home-pages)/home/HomeLayout.tsx index 7c31a67f..f5406650 100644 --- a/app/(home-pages)/home/HomeLayout.tsx +++ b/app/(home-pages)/home/HomeLayout.tsx @@ -289,7 +289,8 @@ function useSearchedLeaflets( !!leaflet.leaflets_to_documents?.find((l) => l.document); let drafts = !!leaflet.leaflets_in_publications?.length && !published; let docs = !leaflet.leaflets_in_publications?.length && !archived; - // If no filters are active, show all + + // If no filters are active, show everything that is not archived if ( !filter.drafts && !filter.published && @@ -298,10 +299,11 @@ function useSearchedLeaflets( ) return archived === false || archived === null || archived == undefined; + //if a filter is on, return itemsd of that filter that are also NOT archived return ( - (filter.drafts && drafts) || - (filter.published && published) || - (filter.docs && docs) || + (filter.drafts && drafts && !archived) || + (filter.published && published && !archived) || + (filter.docs && docs && !archived) || (filter.archived && archived) ); }, diff --git a/app/(home-pages)/home/LeafletList/LeafletOptions.tsx b/app/(home-pages)/home/LeafletList/LeafletOptions.tsx index 2afc85ca..99930da9 100644 --- a/app/(home-pages)/home/LeafletList/LeafletOptions.tsx +++ b/app/(home-pages)/home/LeafletList/LeafletOptions.tsx @@ -108,7 +108,7 @@ const DefaultOptions = (props: { await archivePost(tokenId); toaster({ content: ( -
+
Archived {itemType}!