Skip to content

Commit

Permalink
Fix TypeScript errors in frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
openhands-agent committed Dec 1, 2024
1 parent 981a7d1 commit c5a1e41
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
4 changes: 2 additions & 2 deletions frontend/src/routes/_oh.app/messages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ export function Messages({
}: MessagesProps) {
return messages.map((message, index) =>
isErrorMessage(message) ? (
<ErrorMessage key={index} id={message.id} message={message.message} />
<ErrorMessage key={index} message={message.message} />
) : (
<ChatMessage key={index} type={message.sender} message={message.content}>
{message.imageUrls.length > 0 && (
{message.imageUrls && message.imageUrls.length > 0 && (
<ImageCarousel size="small" images={message.imageUrls} />
)}
{messages.length - 1 === index &&
Expand Down
9 changes: 1 addition & 8 deletions frontend/src/services/observations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,7 @@ export function handleObservationMessage(message: ObservationMessage) {
);
break;
default:
// For any unhandled observation types, dispatch a generic observation
store.dispatch(
addAssistantObservation({
...baseObservation,
observation: observation as const,
extras: message.extras,
}),
);
// For any unhandled observation types, just ignore them
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/types/core/base.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type OpenHandsEventType =
export type OpenHandsEventType =
| "message"
| "agent_state_changed"
| "run"
Expand Down

0 comments on commit c5a1e41

Please sign in to comment.