From c4b146811d236ea4935c7a68308de2a5493aaa45 Mon Sep 17 00:00:00 2001 From: barshathakuri Date: Fri, 30 Aug 2024 10:50:58 +0545 Subject: [PATCH] Fix hide/unhide entries --- app/components/LeftPaneEntries/index.tsx | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/app/components/LeftPaneEntries/index.tsx b/app/components/LeftPaneEntries/index.tsx index 307f393bd..d8d9d9bdd 100644 --- a/app/components/LeftPaneEntries/index.tsx +++ b/app/components/LeftPaneEntries/index.tsx @@ -95,6 +95,7 @@ const LEAD_PREVIEW = gql` $page: Int, $pageSize: Int, $excludeAttachmentIds: [ID!], + $excludeWithEntries: Boolean, ) { project(id: $projectId) { id @@ -103,6 +104,7 @@ const LEAD_PREVIEW = gql` page: $page, pageSize: $pageSize, excludeAttachmentIds: $excludeAttachmentIds, + excludeWithEntries: $excludeWithEntries, ) { results { id @@ -240,7 +242,7 @@ function LeftPaneEntries(props: Props) { autoEntriesModalShown, showAutoEntriesModal, hideAutoEntriesModal, - ] = useModalState(false); + ] = useModalState(true); useEffect(() => { if (activeTabRef) { @@ -292,6 +294,7 @@ function LeftPaneEntries(props: Props) { excludeAttachmentIds: attachmentsWithEntriesHidden ? leadAttachmentIdsWithEntries : [], + excludeWithEntries: attachmentsWithEntriesHidden, }) : undefined), [ leadId, @@ -315,6 +318,8 @@ function LeftPaneEntries(props: Props) { }, ); + console.info('lead', 'data', leadAttachmentIdsWithEntries, leadPreviewData?.project?.leadPreviewAttachments?.results); + const leadPreview = leadPreviewData?.project?.lead?.leadPreview; const extractionStatus = leadPreviewData?.project?.lead?.extractionStatus; const leadPreviewAttachments = leadPreviewData?.project?.leadPreviewAttachments?.results; @@ -899,14 +904,12 @@ function LeftPaneEntries(props: Props) { activeClassName={styles.visualsTab} retainMount="lazy" > - {isDefined(leadPreviewCount) && (leadPreviewCount > 0) && ( - - )} +