diff --git a/src/components/documents/documents-hub.tsx b/src/components/documents/documents-hub.tsx index 616be8af..4bf7979c 100644 --- a/src/components/documents/documents-hub.tsx +++ b/src/components/documents/documents-hub.tsx @@ -120,11 +120,11 @@ export function DocumentsHub({ portSlug, initialTab = 'all' }: DocumentsHubProps }); const { data: flagsResp } = useQuery<{ data: { showExpiredTab: boolean } }>({ - queryKey: ['documents', 'feature-flags'], + queryKey: ['documents-feature-flags'], queryFn: () => apiFetch('/api/v1/documents/feature-flags'), staleTime: 5 * 60 * 1000, }); - const showExpiredTab = flagsResp?.data.showExpiredTab ?? true; + const showExpiredTab = flagsResp?.data?.showExpiredTab ?? true; useRealtimeInvalidation({ 'document:created': [['documents']], @@ -282,16 +282,18 @@ export function DocumentsHub({ portSlug, initialTab = 'all' }: DocumentsHubProps }} > - {documentsHubTabs.filter((t) => t !== 'expired' || showExpiredTab).map((t) => ( - - {TAB_LABELS[t]} - {t !== 'all' && counts[t] > 0 ? ( - - {counts[t]} - - ) : null} - - ))} + {documentsHubTabs + .filter((t) => t !== 'expired' || showExpiredTab) + .map((t) => ( + + {TAB_LABELS[t]} + {t !== 'all' && counts[t] > 0 ? ( + + {counts[t]} + + ) : null} + + ))}