Fix undefined isCanceled variable
The variable `isCanceled` was not defined in the scope of the `setTimeout` callback within `deleteTransactionCore.ts`, leading to an error. This commit defines `isCanceled` within the scope to resolve the issue.
This commit is contained in:
@@ -105,14 +105,14 @@ export const useDeleteTransactionCore = (
|
|||||||
pendingDeletionRef.current?.delete(id);
|
pendingDeletionRef.current?.delete(id);
|
||||||
reject(error);
|
reject(error);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// cancel 함수에서 참조할 수 있도록 클로저로 isCanceled 변수 노출
|
||||||
(promiseObj as any).cancel = () => {
|
(promiseObj as any).cancel = () => {
|
||||||
isCanceled = true;
|
isCanceled = true;
|
||||||
pendingDeletionRef.current?.delete(id);
|
pendingDeletionRef.current?.delete(id);
|
||||||
console.log('트랜잭션 삭제 작업 취소 완료');
|
console.log('트랜잭션 삭제 작업 취소 완료');
|
||||||
};
|
};
|
||||||
|
});
|
||||||
|
|
||||||
return promiseObj;
|
return promiseObj;
|
||||||
}, [transactions, setTransactions, user]);
|
}, [transactions, setTransactions, user]);
|
||||||
|
|||||||
Reference in New Issue
Block a user