Skip to content

A local-first personal finance app

:bug: (dashboards) save cash flow balance setting (#3745)

Matiss Janis Aboltinsc52e5c856d86
diff --git a/packages/desktop-client/src/components/reports/reports/CashFlow.tsx b/packages/desktop-client/src/components/reports/reports/CashFlow.tsx
index 4714ceb3bc..e0d931df1e 100644
--- a/packages/desktop-client/src/components/reports/reports/CashFlow.tsx
+++ b/packages/desktop-client/src/components/reports/reports/CashFlow.tsx
@@ -90,7 +90,9 @@ function CashFlowInner({ widget }: CashFlowInnerProps) {
const [start, setStart] = useState(initialStart);
const [end, setEnd] = useState(initialEnd);
const [mode, setMode] = useState(initialMode);
- const [showBalance, setShowBalance] = useState(true);
+ const [showBalance, setShowBalance] = useState(
+ widget?.meta?.showBalance ?? true,
+ );
const [isConcise, setIsConcise] = useState(() => {
const numDays = d.differenceInCalendarDays(
@@ -158,6 +160,7 @@ function CashFlowInner({ widget }: CashFlowInnerProps) {
end,
mode,
},
+ showBalance,
},
});
dispatch(
diff --git a/packages/loot-core/src/types/models/dashboard.d.ts b/packages/loot-core/src/types/models/dashboard.d.ts
index 0b79913ea9..29a73e15ef 100644
--- a/packages/loot-core/src/types/models/dashboard.d.ts
+++ b/packages/loot-core/src/types/models/dashboard.d.ts
@@ -37,6 +37,7 @@ export type CashFlowWidget = AbstractWidget<
conditions?: RuleConditionEntity[];
conditionsOp?: 'and' | 'or';
timeFrame?: TimeFrame;
+ showBalance?: boolean;
} | null
>;
export type SpendingWidget = AbstractWidget<
diff --git a/upcoming-release-notes/3745.md b/upcoming-release-notes/3745.md
new file mode 100644
index 0000000000..86ab28c5c3
--- /dev/null
+++ b/upcoming-release-notes/3745.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [MatissJanis]
+---
+
+Dashboards: save cash-flow balance setting with the widget.