diff --git a/packages/desktop-client/src/components/reports/reports/CustomReportListCards.tsx b/packages/desktop-client/src/components/reports/reports/CustomReportListCards.tsx index a083b991dc1eef7a1c3421f4707f14972db998c7..a96c99415ec319b910bb9ba5984bd4d08f96ffc4 100644 --- a/packages/desktop-client/src/components/reports/reports/CustomReportListCards.tsx +++ b/packages/desktop-client/src/components/reports/reports/CustomReportListCards.tsx @@ -9,6 +9,7 @@ import { type CustomReportEntity } from 'loot-core/types/models/reports'; import { useAccounts } from '../../../hooks/useAccounts'; import { useCategories } from '../../../hooks/useCategories'; +import { useFeatureFlag } from '../../../hooks/useFeatureFlag'; import { usePayees } from '../../../hooks/usePayees'; import { useSyncedPref } from '../../../hooks/useSyncedPref'; import { SvgExclamationSolid } from '../../../icons/v1'; @@ -35,9 +36,15 @@ export function CustomReportListCards({ report, onRemove, }: CustomReportListCardsProps) { + const isDashboardsFeatureEnabled = useFeatureFlag('dashboards'); + // It's possible for a dashboard to reference a non-existing // custom report if (!report) { + if (!isDashboardsFeatureEnabled) { + return null; + } + return ( <MissingReportCard isEditing={isEditing} onRemove={onRemove}> This custom report has been deleted. diff --git a/upcoming-release-notes/3469.md b/upcoming-release-notes/3469.md new file mode 100644 index 0000000000000000000000000000000000000000..a5ff4ae73ea0eb5a3a13f9b8a696beea63d3d5db --- /dev/null +++ b/upcoming-release-notes/3469.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [MatissJanis] +--- + +Reports - deleting custom reports should remove the widget from the dashboard.