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

Function editThread

apps/web/ui/ChannelView/index.tsx:649–683  ·  view source on GitHub ↗
({
    id,
    message,
    title,
    files,
  }: {
    id: string;
    message: string;
    title?: string;
    files: UploadedFile[];
  })

Source from the content-addressed store, hash-verified

647 };
648
649 const editThread = ({
650 id,
651 message,
652 title,
653 files,
654 }: {
655 id: string;
656 message: string;
657 title?: string;
658 files: UploadedFile[];
659 }) => {
660 setThreads((threads) => {
661 return threads.map((thread) => {
662 if (thread.id === id) {
663 const messages = thread.messages;
664 messages[0].body = message;
665 return {
666 ...thread,
667 title,
668 messages,
669 };
670 }
671 return thread;
672 });
673 });
674 return api
675 .updateThread({
676 accountId: settings.communityId,
677 id,
678 title,
679 })
680 .catch((_) => {
681 Toast.error('Failed to edit the thread.');
682 });
683 };
684
685 const editMessage = async ({
686 id: messageId,

Callers

nothing calls this directly

Calls 3

mapMethod · 0.80
updateThreadMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected