From 9fedb3f16944a5421e7c02d49a2b8a02dd69cdfe Mon Sep 17 00:00:00 2001 From: Jing Hua Date: Tue, 7 Mar 2023 23:04:37 +0800 Subject: [PATCH] release readable stream issue #38 --- src/hooks/useSubmit.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hooks/useSubmit.ts b/src/hooks/useSubmit.ts index 87aab05..b0935a6 100644 --- a/src/hooks/useSubmit.ts +++ b/src/hooks/useSubmit.ts @@ -89,6 +89,8 @@ const useSubmit = () => { } else { reader.cancel('Generation completed'); } + reader.releaseLock(); + stream.cancel(); } } catch (e: unknown) { const err = (e as Error).message;