Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Nov 22, 2024
1 parent 36646a8 commit 0ab65a2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions examples/experimental/nodes/frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ const App: React.FC = () => {
const handleNewMessage = (data: any) => {
try {
const messageData = JSON.parse(data.message);

// Check if it's an agent action
if (messageData.data?.data_type === "agent_action") {
handleAgentAction(messageData);
}
}
// Check if it's a command output
else if (messageData.data?.data_type === "text" &&
else if (messageData.data?.data_type === "text" &&
messageData.data.text.includes("CmdOutputObservation")) {
const parts = messageData.data.text.split("**CmdOutputObservation (source=None, exit code=0)**");
if (parts.length > 1) {
Expand All @@ -63,7 +63,7 @@ const App: React.FC = () => {
}
// Log the message for debugging
console.log('Parsed message:', messageData);

} catch (error) {
console.error('Error parsing message:', error);
}
Expand Down Expand Up @@ -182,8 +182,8 @@ const App: React.FC = () => {
</div>
</div>
<div id="chat-container">
<ChatInterface
messages={messages}
<ChatInterface
messages={messages}
socket={socket}
onSendMessage={(text: string) => {
setMessages(prev => [...prev, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ interface ChatInterfaceProps {
onSendMessage: (text: string) => void;
}

export const ChatInterface: React.FC<ChatInterfaceProps> = ({
messages,
socket,
onSendMessage
export const ChatInterface: React.FC<ChatInterfaceProps> = ({
messages,
socket,
onSendMessage
}) => {
const [input, setInput] = useState('');
const messagesEndRef = React.useRef<HTMLDivElement>(null);

console.log("ChatInterface received messages:", messages);

const scrollToBottom = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ export const Terminal: React.FC<TerminalProps> = ({ externalMessages, socket })
</div>
</div>
);
};
};

0 comments on commit 0ab65a2

Please sign in to comment.