Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/happy-app/sources/components/ChatList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ const ListHeader = React.memo(() => {
});

const ListFooter = React.memo((props: { sessionId: string }) => {
const session = useSession(props.sessionId)!;
const session = useSession(props.sessionId);
if (!session) {
return null;
}
Comment on lines +31 to +33

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for adding the null checks, there is a lack of general null safety that breaks constantly. hope maintainers expedite the reviews on these critical ones

return (
<ChatFooter controlledByUser={session.agentState?.controlledByUser || false} />
)
Expand Down
4 changes: 3 additions & 1 deletion packages/happy-app/sources/components/tools/ToolHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ export function ToolHeader({ tool }: ToolHeaderProps) {
}
}

const icon = knownTool?.icon ? knownTool.icon(18, theme.colors.header.tint) : <Ionicons name="construct-outline" size={18} color={theme.colors.header.tint} />;
const icon = knownTool && typeof knownTool.icon === 'function'
? knownTool.icon(18, theme.colors.header.tint)
: <Ionicons name="construct-outline" size={18} color={theme.colors.header.tint} />;

// Extract subtitle using the same logic as ToolView
let subtitle = null;
Expand Down