()
| 81 | |
| 82 | // Auto-scroll logic |
| 83 | const isAtBottom = () => { |
| 84 | const container = isFullscreen ? fullscreenScrollRef.current : scrollAreaRef.current; |
| 85 | if (container) { |
| 86 | const { scrollTop, scrollHeight, clientHeight } = container; |
| 87 | const distanceFromBottom = scrollHeight - scrollTop - clientHeight; |
| 88 | return distanceFromBottom < 1; |
| 89 | } |
| 90 | return true; |
| 91 | }; |
| 92 | |
| 93 | const scrollToBottom = () => { |
| 94 | if (!hasUserScrolled) { |
no outgoing calls
no test coverage detected