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

Function updateThread

apps/web/ui/ChannelView/index.tsx:610–647  ·  view source on GitHub ↗
({
    state: newState,
    title: newTitle,
  }: {
    state?: ThreadState;
    title?: string;
  })

Source from the content-addressed store, hash-verified

608 };
609
610 const updateThread = ({
611 state: newState,
612 title: newTitle,
613 }: {
614 state?: ThreadState;
615 title?: string;
616 }) => {
617 if (!currentThreadId) {
618 return;
619 }
620 const options: { state?: ThreadState; title?: string } = {};
621 if (newState) {
622 options.state = newState;
623 }
624 if (newTitle) {
625 options.title = newTitle;
626 }
627 setThreads((threads) => {
628 return threads.map((thread) => {
629 if (thread.id === currentThreadId) {
630 return {
631 ...thread,
632 ...options,
633 };
634 }
635 return thread;
636 });
637 });
638 return api
639 .updateThread({
640 accountId: settings.communityId,
641 id: currentThreadId,
642 ...options,
643 })
644 .catch((_) => {
645 Toast.error('Failed to close the thread.');
646 });
647 };
648
649 const editThread = ({
650 id,

Callers

nothing calls this directly

Calls 3

mapMethod · 0.80
updateThreadMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected