(offset = 0)
| 361 | }; |
| 362 | |
| 363 | function scrollDown(offset = 0) { |
| 364 | const scrollableRoot = scrollableRootRef.current; |
| 365 | const lastScrollDistanceToBottom = |
| 366 | lastScrollDistanceToBottomRef.current || 0; |
| 367 | if (scrollableRoot) { |
| 368 | scrollableRoot.scrollTop = |
| 369 | scrollableRoot.scrollHeight - lastScrollDistanceToBottom + offset; |
| 370 | } |
| 371 | } |
| 372 | |
| 373 | const threadToRender = threads.find( |
| 374 | (thread) => thread.id === currentThreadId |