mirror of
https://github.com/aaif-goose/goose.git
synced 2026-07-03 14:10:03 +02:00
cleanup and fix messages re-rendering while chat is streaming
This commit is contained in:
@@ -189,7 +189,7 @@ export default function ProgressiveMessageList({
|
||||
|
||||
return (
|
||||
<div
|
||||
key={message.id && `${message.id}-${message.content.length}`}
|
||||
key={message.id || `message-${index}`}
|
||||
className={`relative ${index === 0 ? 'mt-0' : 'mt-4'} ${isUser ? 'user' : 'assistant'}`}
|
||||
data-testid="message-container"
|
||||
>
|
||||
|
||||
@@ -3,10 +3,6 @@ import { Session } from '../api';
|
||||
import { useSessionStreamContext } from '../contexts/SessionStreamContext';
|
||||
|
||||
interface UseSessionStreamOptions {
|
||||
/**
|
||||
* Whether to enable streaming. If false, will not connect.
|
||||
* @default true
|
||||
*/
|
||||
enabled?: boolean;
|
||||
onUpdate?: (session: Session) => void;
|
||||
onError?: (error: string) => void;
|
||||
@@ -45,7 +41,6 @@ export function useSessionStream(
|
||||
const onUpdateRef = useRef(onUpdate);
|
||||
const onErrorRef = useRef(onError);
|
||||
|
||||
// Keep refs up to date
|
||||
useEffect(() => {
|
||||
onUpdateRef.current = onUpdate;
|
||||
onErrorRef.current = onError;
|
||||
|
||||
Reference in New Issue
Block a user