Review expense history page
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user