Skip to content
Snippets Groups Projects
Unverified Commit 25a40419 authored by Matiss Janis Aboltins's avatar Matiss Janis Aboltins Committed by GitHub
Browse files

:bug: (reports) deleting custom report should remove it from the dashboard (#3469)

parent e6bf6da3
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,7 @@ import { type CustomReportEntity } from 'loot-core/types/models/reports'; ...@@ -9,6 +9,7 @@ import { type CustomReportEntity } from 'loot-core/types/models/reports';
import { useAccounts } from '../../../hooks/useAccounts'; import { useAccounts } from '../../../hooks/useAccounts';
import { useCategories } from '../../../hooks/useCategories'; import { useCategories } from '../../../hooks/useCategories';
import { useFeatureFlag } from '../../../hooks/useFeatureFlag';
import { usePayees } from '../../../hooks/usePayees'; import { usePayees } from '../../../hooks/usePayees';
import { useSyncedPref } from '../../../hooks/useSyncedPref'; import { useSyncedPref } from '../../../hooks/useSyncedPref';
import { SvgExclamationSolid } from '../../../icons/v1'; import { SvgExclamationSolid } from '../../../icons/v1';
...@@ -35,9 +36,15 @@ export function CustomReportListCards({ ...@@ -35,9 +36,15 @@ export function CustomReportListCards({
report, report,
onRemove, onRemove,
}: CustomReportListCardsProps) { }: CustomReportListCardsProps) {
const isDashboardsFeatureEnabled = useFeatureFlag('dashboards');
// It's possible for a dashboard to reference a non-existing // It's possible for a dashboard to reference a non-existing
// custom report // custom report
if (!report) { if (!report) {
if (!isDashboardsFeatureEnabled) {
return null;
}
return ( return (
<MissingReportCard isEditing={isEditing} onRemove={onRemove}> <MissingReportCard isEditing={isEditing} onRemove={onRemove}>
This custom report has been deleted. This custom report has been deleted.
......
---
category: Bugfix
authors: [MatissJanis]
---
Reports - deleting custom reports should remove the widget from the dashboard.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment