(threadId: string)
| 299 | } |
| 300 | |
| 301 | async function selectThread(threadId: string) { |
| 302 | const text = getSelectedText(); |
| 303 | if (text) { |
| 304 | return null; |
| 305 | } |
| 306 | const currentThread = |
| 307 | threads.find((t) => t.id === threadId) || |
| 308 | pinnedThreads.find((t) => t.id === threadId); |
| 309 | |
| 310 | if (!currentThread) { |
| 311 | return; |
| 312 | } |
| 313 | onSelectThread(currentThread.id); |
| 314 | const isLastThread = currentThread.id === threads[threads.length - 1].id; |
| 315 | if (isLastThread) { |
| 316 | setTimeout(() => handleScroll(), 0); |
| 317 | } |
| 318 | handleLeftScroll(); |
| 319 | } |
| 320 | |
| 321 | const rootMargin = |
| 322 | viewport === 'desktop' ? '640px 0px 640px 0px' : '0px 0px 0px 0px'; |
no test coverage detected