Review expense history page

This commit is contained in:
gpt-engineer-app[bot]
2025-03-18 04:12:54 +00:00
parent a0074c2d1d
commit 2b8069a150
5 changed files with 75 additions and 135 deletions

View File

@@ -34,12 +34,12 @@ const Transactions = () => {
}
}, [budgetData, isLoading]);
// 트랜잭션 삭제 핸들러 (성능 및 안정성 개선)
// 트랜잭션 삭제 핸들러 - 간소화 및 안정성 개선
const handleTransactionDelete = async (id: string) => {
// 이미 처리 중인 경우 작업 무시
if (isProcessing || deletingId === id) {
console.log('이미 삭제 작업이 진행 중입니다:', deletingId);
return;
return false;
}
try {
@@ -49,18 +49,20 @@ const Transactions = () => {
setIsProcessing(true);
setDeletingId(id);
// 비동기 삭제 작업 실행
// 간소화된 삭제 작업 실행
const success = await deleteTransaction(id);
// 데이터 새로고침 (UI 응답성 향상을 위해 약간 지연)
// 상태 초기화
setTimeout(() => {
refreshTransactions();
// 상태 초기화
setIsProcessing(false);
setDeletingId(null);
}, 300);
// 성공 여부와 관계없이 데이터 새로고침
setTimeout(() => {
refreshTransactions();
}, 500);
return success;
} catch (error) {
console.error('트랜잭션 삭제 처리 중 오류:', error);