Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

fix(ui): handle possibly undefined values in strict mode

Naiyuan Qing24c3af118553
diff --git a/packages/ui/src/components/chat-view.tsx b/packages/ui/src/components/chat-view.tsx
index dcdded48c2..f50940908c 100644
--- a/packages/ui/src/components/chat-view.tsx
+++ b/packages/ui/src/components/chat-view.tsx
@@ -108,8 +108,9 @@ export function ChatView({
if (!sentinel || isLoadingHistory) return;
const observer = new IntersectionObserver(
- ([entry]) => {
- if (entry.isIntersecting && hasMore && !isLoadingMore) {
+ (entries) => {
+ const entry = entries[0];
+ if (entry?.isIntersecting && hasMore && !isLoadingMore) {
onLoadMore();
}
},
diff --git a/packages/ui/src/components/markdown/StreamingMarkdown.tsx b/packages/ui/src/components/markdown/StreamingMarkdown.tsx
index 1bb30d4f61..fc50963f4c 100644
--- a/packages/ui/src/components/markdown/StreamingMarkdown.tsx
+++ b/packages/ui/src/components/markdown/StreamingMarkdown.tsx
@@ -51,7 +51,7 @@ function splitIntoBlocks(content: string): Block[] {
let inCodeBlock = false
for (let i = 0; i < lines.length; i++) {
- const line = lines[i]
+ const line = lines[i] ?? ''
// Check for code fence (``` at start of line, optionally followed by language)
if (line.startsWith('```')) {