fix: address reviewer feedback (#29)
- Remove dead code: navigateBudgetMonth function and its export from useReports.ts (replaced by setBudgetMonth, no longer imported anywhere) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
0d324b89c4
commit
8971e443d8
1 changed files with 1 additions and 14 deletions
|
|
@ -224,19 +224,6 @@ export function useReports() {
|
||||||
dispatch({ type: "SET_PERIOD", payload: period });
|
dispatch({ type: "SET_PERIOD", payload: period });
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const navigateBudgetMonth = useCallback((delta: -1 | 1) => {
|
|
||||||
let newMonth = state.budgetMonth + delta;
|
|
||||||
let newYear = state.budgetYear;
|
|
||||||
if (newMonth < 1) {
|
|
||||||
newMonth = 12;
|
|
||||||
newYear -= 1;
|
|
||||||
} else if (newMonth > 12) {
|
|
||||||
newMonth = 1;
|
|
||||||
newYear += 1;
|
|
||||||
}
|
|
||||||
dispatch({ type: "SET_BUDGET_MONTH", payload: { year: newYear, month: newMonth } });
|
|
||||||
}, [state.budgetYear, state.budgetMonth]);
|
|
||||||
|
|
||||||
const setBudgetMonth = useCallback((year: number, month: number) => {
|
const setBudgetMonth = useCallback((year: number, month: number) => {
|
||||||
dispatch({ type: "SET_BUDGET_MONTH", payload: { year, month } });
|
dispatch({ type: "SET_BUDGET_MONTH", payload: { year, month } });
|
||||||
}, []);
|
}, []);
|
||||||
|
|
@ -253,5 +240,5 @@ export function useReports() {
|
||||||
dispatch({ type: "SET_SOURCE_ID", payload: id });
|
dispatch({ type: "SET_SOURCE_ID", payload: id });
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return { state, setTab, setPeriod, setCustomDates, navigateBudgetMonth, setBudgetMonth, setPivotConfig, setSourceId };
|
return { state, setTab, setPeriod, setCustomDates, setBudgetMonth, setPivotConfig, setSourceId };
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue