Skip to content

Commit

Permalink
Fix hide/unhide entries
Browse files Browse the repository at this point in the history
  • Loading branch information
barshathakuri committed Aug 30, 2024
1 parent f088b2f commit c4b1468
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions app/components/LeftPaneEntries/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const LEAD_PREVIEW = gql`
$page: Int,
$pageSize: Int,
$excludeAttachmentIds: [ID!],
$excludeWithEntries: Boolean,
) {
project(id: $projectId) {
id
Expand All @@ -103,6 +104,7 @@ const LEAD_PREVIEW = gql`
page: $page,
pageSize: $pageSize,
excludeAttachmentIds: $excludeAttachmentIds,
excludeWithEntries: $excludeWithEntries,
) {
results {
id
Expand Down Expand Up @@ -240,7 +242,7 @@ function LeftPaneEntries(props: Props) {
autoEntriesModalShown,
showAutoEntriesModal,
hideAutoEntriesModal,
] = useModalState(false);
] = useModalState(true);

useEffect(() => {
if (activeTabRef) {
Expand Down Expand Up @@ -292,6 +294,7 @@ function LeftPaneEntries(props: Props) {
excludeAttachmentIds: attachmentsWithEntriesHidden
? leadAttachmentIdsWithEntries
: [],
excludeWithEntries: attachmentsWithEntriesHidden,
}) : undefined),
[
leadId,
Expand All @@ -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;
Expand Down Expand Up @@ -899,14 +904,12 @@ function LeftPaneEntries(props: Props) {
activeClassName={styles.visualsTab}
retainMount="lazy"
>
{isDefined(leadPreviewCount) && (leadPreviewCount > 0) && (
<Switch
name="hide attachments"
label="Hide Created entries"
value={attachmentsWithEntriesHidden}
onChange={setAttachmentsWithEntriesHidden}
/>
)}
<Switch
name="hide attachments"
label="Hide Created entries"
value={attachmentsWithEntriesHidden}
onChange={setAttachmentsWithEntriesHidden}
/>
<ListView
spacing="comfortable"
direction="vertical"
Expand Down

0 comments on commit c4b1468

Please sign in to comment.