Skip to content

A local-first personal finance app

no hidden (#5305)

youngcwca969cc61bd6
diff --git a/packages/desktop-client/src/components/mobile/budget/BudgetTable.jsx b/packages/desktop-client/src/components/mobile/budget/BudgetTable.jsx
index e7a4e81f85..1a01a57a2b 100644
--- a/packages/desktop-client/src/components/mobile/budget/BudgetTable.jsx
+++ b/packages/desktop-client/src/components/mobile/budget/BudgetTable.jsx
@@ -567,15 +567,21 @@ function OverbudgetedBanner({ month, onBudgetAction, ...props }) {
);
}
-function OverspendingBanner({ month, onBudgetAction, ...props }) {
+function OverspendingBanner({ month, onBudgetAction, budgetType, ...props }) {
const { t } = useTranslation();
const { list: categories, grouped: categoryGroups } = useCategories();
const categoriesById = groupById(categories);
+ const groupsById = groupById(categoryGroups);
const dispatch = useDispatch();
- const overspentCategories = useOverspentCategories({ month });
+ const overspentCategories = useOverspentCategories({ month }).filter(c => {
+ if (budgetType === 'tracking') {
+ return !c.hidden && !groupsById[c.group].hidden;
+ }
+ return true;
+ });
const categoryGroupsToShow = useMemo(
() =>
@@ -694,7 +700,11 @@ function Banners({ month, onBudgetAction }) {
style={{ backgroundColor: theme.mobilePageBackground }}
>
<UncategorizedTransactionsBanner />
- <OverspendingBanner month={month} onBudgetAction={onBudgetAction} />
+ <OverspendingBanner
+ month={month}
+ onBudgetAction={onBudgetAction}
+ budgetType={budgetType}
+ />
{budgetType === 'envelope' && (
<OverbudgetedBanner month={month} onBudgetAction={onBudgetAction} />
)}
diff --git a/upcoming-release-notes/5305.md b/upcoming-release-notes/5305.md
new file mode 100644
index 0000000000..2c5ace7637
--- /dev/null
+++ b/upcoming-release-notes/5305.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [youngcw]
+---
+
+Fix overspent categories banner including hidden categories in the tracking budget