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

Function updateThread

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

Source from the content-addressed store, hash-verified

75 };
76
77 const updateThread = ({
78 state: newState,
79 title: newTitle,
80 }: {
81 state?: ThreadState;
82 title?: string;
83 }) => {
84 const options = {
85 state: newState || thread.state,
86 title: newTitle || thread.title || undefined,
87 };
88 setThread((thread: SerializedThread) => {
89 return {
90 ...thread,
91 ...options,
92 };
93 });
94 return api
95 .updateThread({
96 accountId: settings.communityId,
97 id: thread.id,
98 ...options,
99 })
100 .catch((_) => {
101 Toast.error('Failed to close the thread.');
102 });
103 };
104
105 const editMessage = ({ id, body }: { id: string; body: string }) => {
106 setThread((thread: SerializedThread) => {

Callers 1

ThreadFunction · 0.50

Calls 2

updateThreadMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected