MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / onThreadMessage

Function onThreadMessage

apps/web/ui/ThreadView/Content/index.tsx:55–75  ·  view source on GitHub ↗
(
    threadId: string,
    message: SerializedMessage,
    messageId: string,
    imitationId: string
  )

Source from the content-addressed store, hash-verified

53 const currentUser = permissions.user;
54
55 const onThreadMessage = (
56 threadId: string,
57 message: SerializedMessage,
58 messageId: string,
59 imitationId: string
60 ) => {
61 setThread((thread: SerializedThread) => {
62 if (thread.id === threadId) {
63 return {
64 ...thread,
65 messages: [
66 ...thread.messages.filter(
67 ({ id }: any) => id !== imitationId && id !== messageId
68 ),
69 message,
70 ],
71 };
72 }
73 return thread;
74 });
75 };
76
77 const updateThread = ({
78 state: newState,

Callers 1

ContentFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected