(threadId: string, scroll: boolean = true)
| 307 | } |
| 308 | |
| 309 | async function selectThread(threadId: string, scroll: boolean = true) { |
| 310 | const text = getSelectedText(); |
| 311 | if (text) { |
| 312 | return null; |
| 313 | } |
| 314 | const currentThread = |
| 315 | threads.find((t) => t.id === threadId) || |
| 316 | pinnedThreads.find((t) => t.id === threadId); |
| 317 | |
| 318 | if (!currentThread) { |
| 319 | return; |
| 320 | } |
| 321 | onSelectThread(currentThread.id); |
| 322 | const isLastThread = currentThread.id === threads[threads.length - 1].id; |
| 323 | if (isLastThread) { |
| 324 | setTimeout(() => handleScroll(), 0); |
| 325 | } |
| 326 | |
| 327 | scroll && handleLeftScroll(); |
| 328 | } |
| 329 | |
| 330 | const rootMargin = |
| 331 | viewport === 'desktop' ? '640px 0px 640px 0px' : '0px 0px 0px 0px'; |
no test coverage detected