Fix data initialization and toast issues

- Ensure toast notifications disappear after data initialization.
- Resolve issues with expense items not displaying on the expense page.
- Fix graph display issues on the analytics screen.
- Prevent login screen from appearing after data initialization.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-16 08:49:04 +00:00
parent fe669b0cfd
commit e392557b9c
5 changed files with 216 additions and 102 deletions

View File

@@ -31,7 +31,10 @@ const MonthlyComparisonChart: React.FC<MonthlyComparisonChartProps> = ({
return value;
};
// Empty state component
// 데이터 확인 로깅
console.log('MonthlyComparisonChart 데이터:', monthlyData);
// EmptyGraphState 컴포넌트: 데이터가 없을 때 표시
const EmptyGraphState = () => (
<div className="flex flex-col items-center justify-center h-48 text-gray-400">
<p> </p>
@@ -39,9 +42,14 @@ const MonthlyComparisonChart: React.FC<MonthlyComparisonChartProps> = ({
</div>
);
// 데이터 여부 확인 로직 개선 - 데이터가 비어있거나 모든 값이 0인 경우도 고려
const hasValidData = monthlyData &&
monthlyData.length > 0 &&
monthlyData.some(item => item.budget > 0 || item.expense > 0);
return (
<div className="neuro-card h-72 w-full">
{!isEmpty && monthlyData.length > 0 && monthlyData.some(item => item.budget > 0 || item.expense > 0) ? (
{hasValidData ? (
<ResponsiveContainer width="100%" height="100%">
<BarChart data={monthlyData} margin={{
top: 20,