diff --git a/app/components/chat.tsx b/app/components/chat.tsx index ea1eb7e2b..90c88d97b 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -445,8 +445,10 @@ export function Chat(props: { chatStore .onUserInput(messages[i].content) .then(() => setIsLoading(false)); + chatStore.updateCurrentSession((session) => + session.messages.splice(i, 2), + ); inputRef.current?.focus(); - messages.splice(i, 2); return; } }