Fix budget calculation and display
Ensure daily and weekly budgets are calculated correctly based on the monthly budget, and that the monthly budget is consistent across the app.
This commit is contained in:
@@ -8,8 +8,11 @@ import { safelyLoadBudgetData } from '../budgetUtils';
|
||||
*/
|
||||
export const useBudgetState = () => {
|
||||
// 초기 데이터 로드 시 safelyLoadBudgetData 함수 사용
|
||||
const [budgetData, setBudgetData] = useState<BudgetData>(safelyLoadBudgetData());
|
||||
const [selectedTab, setSelectedTab] = useState<BudgetPeriod>("daily"); // 초기값을 daily로 변경
|
||||
const initialBudgetData = safelyLoadBudgetData();
|
||||
console.log('초기 예산 데이터 로드:', initialBudgetData);
|
||||
|
||||
const [budgetData, setBudgetData] = useState<BudgetData>(initialBudgetData);
|
||||
const [selectedTab, setSelectedTab] = useState<BudgetPeriod>("daily"); // 초기값은 daily
|
||||
const [isInitialized, setIsInitialized] = useState(false);
|
||||
const [lastUpdateTime, setLastUpdateTime] = useState(0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user