Skip to content

Commit

Permalink
🐛 (dashboards) save cash flow balance setting
Browse files Browse the repository at this point in the history
Closes #3671
  • Loading branch information
MatissJanis committed Oct 27, 2024
1 parent f265dd9 commit 2cc5416
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -158,6 +160,7 @@ function CashFlowInner({ widget }: CashFlowInnerProps) {
end,
mode,
},
showBalance,
},
});
dispatch(
Expand Down
1 change: 1 addition & 0 deletions packages/loot-core/src/types/models/dashboard.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export type CashFlowWidget = AbstractWidget<
conditions?: RuleConditionEntity[];
conditionsOp?: 'and' | 'or';
timeFrame?: TimeFrame;
showBalance?: boolean;
} | null
>;
export type SpendingWidget = AbstractWidget<
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/3745.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [MatissJanis]
---

Dashboards: save cash-flow balance setting with the widget.

0 comments on commit 2cc5416

Please sign in to comment.