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,15 +105,15 @@ export const useDeleteTransactionCore = (
|
||||
pendingDeletionRef.current?.delete(id);
|
||||
reject(error);
|
||||
}
|
||||
|
||||
// cancel 함수에서 참조할 수 있도록 클로저로 isCanceled 변수 노출
|
||||
(promiseObj as any).cancel = () => {
|
||||
isCanceled = true;
|
||||
pendingDeletionRef.current?.delete(id);
|
||||
console.log('트랜잭션 삭제 작업 취소 완료');
|
||||
};
|
||||
});
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(promiseObj as any).cancel = () => {
|
||||
isCanceled = true;
|
||||
pendingDeletionRef.current?.delete(id);
|
||||
console.log('트랜잭션 삭제 작업 취소 완료');
|
||||
};
|
||||
|
||||
return promiseObj;
|
||||
}, [transactions, setTransactions, user]);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user