[PR #3169] [MERGED] Fix budget type toggle not working the first time #11776

Closed
opened 2026-04-10 21:10:09 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/3169
Author: @YusefOuda
Created: 7/31/2024
Status: Merged
Merged: 8/1/2024
Merged by: @MatissJanis

Base: masterHead: bugfix/budget-type-fix


📝 Commits (3)

  • b038165 use default 'rollover' for budgetType localPref
  • 2f68cc9 Merge branch 'master' into bugfix/budget-type-fix
  • 75055f3 release notes

📊 Changes

6 files changed (+11 additions, -7 deletions)

View changed files

📝 packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx (+1 -1)
📝 packages/desktop-client/src/components/budget/index.tsx (+1 -2)
📝 packages/desktop-client/src/components/mobile/budget/index.tsx (+1 -2)
📝 packages/desktop-client/src/components/settings/BudgetTypeSettings.tsx (+1 -1)
📝 packages/desktop-client/src/components/settings/Experimental.tsx (+1 -1)
upcoming-release-notes/3169.md (+6 -0)

📄 Description

Issue: When switching from "rollover" budget to "report" budget for the first time, the toggle doesn't actually work. This is because the localPref budgetType does not have a value initially, and the logic did not handle that so it attempts to toggle to a "rollover" budget (when it is already by default a "rollover")

const newBudgetType = budgetType === 'rollover' ? 'report' : 'rollover';

This PR fixes that issue by defaulting the localPref to "rollover" (also fixed it in other files where we use that localPref.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/3169 **Author:** [@YusefOuda](https://github.com/YusefOuda) **Created:** 7/31/2024 **Status:** ✅ Merged **Merged:** 8/1/2024 **Merged by:** [@MatissJanis](https://github.com/MatissJanis) **Base:** `master` ← **Head:** `bugfix/budget-type-fix` --- ### 📝 Commits (3) - [`b038165`](https://github.com/actualbudget/actual/commit/b0381652e2e00dae694763be03f730a269720129) use default 'rollover' for budgetType localPref - [`2f68cc9`](https://github.com/actualbudget/actual/commit/2f68cc97560116f3703bab2f4b268da519dcb841) Merge branch 'master' into bugfix/budget-type-fix - [`75055f3`](https://github.com/actualbudget/actual/commit/75055f3631b96a197f9e1afbc531687a53109d85) release notes ### 📊 Changes **6 files changed** (+11 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx` (+1 -1) 📝 `packages/desktop-client/src/components/budget/index.tsx` (+1 -2) 📝 `packages/desktop-client/src/components/mobile/budget/index.tsx` (+1 -2) 📝 `packages/desktop-client/src/components/settings/BudgetTypeSettings.tsx` (+1 -1) 📝 `packages/desktop-client/src/components/settings/Experimental.tsx` (+1 -1) ➕ `upcoming-release-notes/3169.md` (+6 -0) </details> ### 📄 Description **Issue**: When switching from "rollover" budget to "report" budget for the first time, the toggle doesn't actually work. This is because the localPref `budgetType` does not have a value initially, and the logic did not handle that so it attempts to toggle to a "rollover" budget (when it is already by default a "rollover") `const newBudgetType = budgetType === 'rollover' ? 'report' : 'rollover';` This PR fixes that issue by defaulting the localPref to "rollover" (also fixed it in other files where we use that localPref. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-10 21:10:09 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#11776