diff --git a/packages/hooks/src/useLockFn/index.ts b/packages/hooks/src/useLockFn/index.ts index 5ce96fba40..5b6eaf14bd 100644 --- a/packages/hooks/src/useLockFn/index.ts +++ b/packages/hooks/src/useLockFn/index.ts @@ -9,11 +9,9 @@ function useLockFn
(fn: (...args: P lockRef.current = true; try { const ret = await fn(...args); - lockRef.current = false; return ret; - } catch (e) { + } finally { lockRef.current = false; - throw e; } }, [fn],