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;