MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / selectThread

Function selectThread

apps/web/ui/ChannelView/TopicView/index.tsx:309–328  ·  view source on GitHub ↗
(threadId: string, scroll: boolean = true)

Source from the content-addressed store, hash-verified

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';

Callers 2

callbackFunction · 0.70
ChannelFunction · 0.70

Calls 5

getSelectedTextFunction · 0.90
onSelectThreadFunction · 0.85
handleScrollFunction · 0.70
handleLeftScrollFunction · 0.70
findMethod · 0.45

Tested by

no test coverage detected