From 6af1f6ab8d5617618589551de273a0c5d5d0fb9b Mon Sep 17 00:00:00 2001 From: L-Sun Date: Fri, 26 Sep 2025 16:59:33 +0800 Subject: [PATCH] fix(core): infinitied loop (#13653) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #13649 #### PR Dependency Tree * **PR #13653** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) ## Summary by CodeRabbit * **Refactor** * Streamlined internal async handling to depend only on specified inputs, reducing unnecessary updates and improving responsiveness. * Preserved existing error handling for async operations. * **Chores** * Adjusted lint configuration/comments to align with the updated dependency strategy, reducing false-positive warnings. No user-facing UI changes. --- .../frontend/core/src/components/hooks/affine-async-hooks.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/frontend/core/src/components/hooks/affine-async-hooks.ts b/packages/frontend/core/src/components/hooks/affine-async-hooks.ts index ae1daeb540..a5e9ba64a1 100644 --- a/packages/frontend/core/src/components/hooks/affine-async-hooks.ts +++ b/packages/frontend/core/src/components/hooks/affine-async-hooks.ts @@ -22,8 +22,9 @@ export function useAsyncCallback( const handleAsyncError = React.useContext(AsyncCallbackContext); return React.useCallback( (...args: any) => { + // oxlint-disable-next-line exhaustive-deps callback(...args).catch(e => handleAsyncError(e)); }, - [callback, handleAsyncError, ...deps] // eslint-disable-line react-hooks/exhaustive-deps + [...deps] // eslint-disable-line react-hooks/exhaustive-deps ); }