mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-06 10:48:12 +02:00
fix(storybook): stop the streaming fixture timer at its limit
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
915ddcf35f
commit
43354eb389
1 file changed
+4
-4
@@ -9,10 +9,10 @@ import { useWindowAutoFollow } from "@/components/task-chat/useWindowAutoFollow"
|
|||||||
function StreamingResponse({ running }: { running: boolean }) {
|
function StreamingResponse({ running }: { running: boolean }) {
|
||||||
const [lines, setLines] = useState(16);
|
const [lines, setLines] = useState(16);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!running) return;
|
if (!running || lines >= 256) return;
|
||||||
const timer = window.setInterval(() => setLines((count) => Math.min(count + 1, 256)), 500);
|
const timer = window.setTimeout(() => setLines(lines + 1), 500);
|
||||||
return () => window.clearInterval(timer);
|
return () => window.clearTimeout(timer);
|
||||||
}, [running]);
|
}, [running, lines]);
|
||||||
return <TaskChatThreadView scroll={false} items={[
|
return <TaskChatThreadView scroll={false} items={[
|
||||||
{ id: "request", kind: "message", author: "human", text: "Give me a detailed progress report as you work." },
|
{ id: "request", kind: "message", author: "human", text: "Give me a detailed progress report as you work." },
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user