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

@@ -1,4 +1,3 @@
import React, { useState } from 'react';
import { Trash2 } from 'lucide-react';
import { Button } from '@/components/ui/button';
@@ -28,6 +27,9 @@ const DataResetSection = () => {
// 초기화 실행 전에 사용자 설정 백업
const dontShowWelcomeValue = localStorage.getItem('dontShowWelcome');
const hasVisitedBefore = localStorage.getItem('hasVisitedBefore');
// 로그인 관련 설정도 백업
const authSession = localStorage.getItem('authSession');
const sb_auth = localStorage.getItem('sb-auth-token');
// 데이터 초기화
resetAllStorageData();
@@ -41,6 +43,15 @@ const DataResetSection = () => {
localStorage.setItem('hasVisitedBefore', hasVisitedBefore);
}
// 로그인 관련 설정 복원 (로그인 화면이 나타나지 않도록)
if (authSession) {
localStorage.setItem('authSession', authSession);
}
if (sb_auth) {
localStorage.setItem('sb-auth-token', sb_auth);
}
// 스토리지 이벤트 트리거하여 다른 컴포넌트에 변경 알림
window.dispatchEvent(new Event('transactionUpdated'));
window.dispatchEvent(new Event('budgetDataUpdated'));
@@ -94,7 +105,7 @@ const DataResetSection = () => {
<DialogTitle> ?</DialogTitle>
<DialogDescription>
, , , .
, '환영합니다' .
, '환영합니다' .
</DialogDescription>
</DialogHeader>
<DialogFooter className="flex flex-col sm:flex-row gap-2 sm:gap-0">