Skip to content

Commit

Permalink
monitor only when its generating
Browse files Browse the repository at this point in the history
  • Loading branch information
nullhook committed Jan 16, 2024
1 parent dd67ec8 commit 8b82674
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions components/ai_chat/resources/page/components/main/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ function Main() {
}

const handleScroll = (e: React.UIEvent<HTMLDivElement>) => {
// Monitor scroll positions only when Assistant is generating
if (!context.isGenerating) return
const el = e.currentTarget
scrollPos.current.isAtBottom = Math.abs(el.scrollHeight - el.clientHeight - el.scrollTop) < SCROLL_BOTTOM_THRESHOLD
}
Expand Down

0 comments on commit 8b82674

Please sign in to comment.