mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-28 10:33:02 -05:00
Fix budget type toggle not working the first time (#3169)
* use default 'rollover' for budgetType localPref * release notes --------- Co-authored-by: Yusef Ouda <5180063+YusefOuda@users.noreply.github.com>
This commit is contained in:
@@ -375,7 +375,7 @@ function CategoryItem({
|
||||
borderTop: `1px solid ${theme.pillBorder}`,
|
||||
}
|
||||
: {};
|
||||
const [budgetType] = useLocalPref('budgetType');
|
||||
const [budgetType = 'rollover'] = useLocalPref('budgetType');
|
||||
|
||||
const balance = useSheetValue(
|
||||
budgetType === 'rollover'
|
||||
|
||||
@@ -75,8 +75,7 @@ function BudgetInner(props: BudgetInnerProps) {
|
||||
start: startMonth,
|
||||
end: startMonth,
|
||||
});
|
||||
const [budgetTypePref] = useLocalPref('budgetType');
|
||||
const budgetType = budgetTypePref || 'rollover';
|
||||
const [budgetType = 'rollover'] = useLocalPref('budgetType');
|
||||
const [maxMonthsPref] = useGlobalPref('maxMonths');
|
||||
const maxMonths = maxMonthsPref || 1;
|
||||
const [initialized, setInitialized] = useState(false);
|
||||
|
||||
@@ -461,8 +461,7 @@ function BudgetInner(props: BudgetInnerProps) {
|
||||
|
||||
export function Budget() {
|
||||
const { list: categories, grouped: categoryGroups } = useCategories();
|
||||
const [_budgetType] = useLocalPref('budgetType');
|
||||
const budgetType = _budgetType || 'rollover';
|
||||
const [budgetType = 'rollover'] = useLocalPref('budgetType');
|
||||
const spreadsheet = useSpreadsheet();
|
||||
useSetThemeColor(theme.mobileViewTheme);
|
||||
return (
|
||||
|
||||
@@ -15,7 +15,7 @@ import { Setting } from './UI';
|
||||
|
||||
export function BudgetTypeSettings() {
|
||||
const dispatch = useDispatch();
|
||||
const [budgetType] = useLocalPref('budgetType');
|
||||
const [budgetType = 'rollover'] = useLocalPref('budgetType');
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const currentMonth = monthUtils.currentMonth();
|
||||
|
||||
@@ -57,7 +57,7 @@ function FeatureToggle({
|
||||
}
|
||||
|
||||
function ReportBudgetFeature() {
|
||||
const [budgetType] = useLocalPref('budgetType');
|
||||
const [budgetType = 'rollover'] = useLocalPref('budgetType');
|
||||
const enabled = useFeatureFlag('reportBudget');
|
||||
const blockToggleOff = budgetType === 'report' && enabled;
|
||||
return (
|
||||
|
||||
6
upcoming-release-notes/3169.md
Normal file
6
upcoming-release-notes/3169.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Bugfix
|
||||
authors: [YusefOuda]
|
||||
---
|
||||
|
||||
Fix budget type toggle not working the first time
|
||||
Reference in New Issue
Block a user