diff --git a/web/hooks/useSendChatMessage.ts b/web/hooks/useSendChatMessage.ts index c8a32564b..15caa62c9 100644 --- a/web/hooks/useSendChatMessage.ts +++ b/web/hooks/useSendChatMessage.ts @@ -172,7 +172,7 @@ export default function useSendChatMessage() { const instructions = activeThread.assistants[0].instructions ?? '' const tools = activeThread.assistants[0].tools ?? [] - const updatedThread: Thread = { + const initThread: Thread = { ...activeThread, assistants: [ { @@ -189,12 +189,13 @@ export default function useSendChatMessage() { }, ], } + updateThreadInitSuccess(activeThread.id) - updateThread(updatedThread) + updateThread(initThread) await extensionManager .get(ExtensionTypeEnum.Conversational) - ?.saveThread(updatedThread) + ?.saveThread(initThread) } updateThreadWaiting(activeThread.id, true) @@ -326,6 +327,14 @@ export default function useSendChatMessage() { setFileUpload([]) } + const updatedThread: Thread = { + ...activeThread, + updated: timestamp, + } + + // cheange last update thread when send message + updateThread(updatedThread) + await extensionManager .get(ExtensionTypeEnum.Conversational) ?.addNewMessage(threadMessage) diff --git a/web/screens/Chat/ThreadList/index.tsx b/web/screens/Chat/ThreadList/index.tsx index b2e15d111..19298062b 100644 --- a/web/screens/Chat/ThreadList/index.tsx +++ b/web/screens/Chat/ThreadList/index.tsx @@ -84,7 +84,6 @@ export default function ThreadList() { threads.map((thread, i) => { const lastMessage = threadStates[thread.id]?.lastMessage ?? 'No new message' - return (
-
-

{thread.title}

-

- {thread.updated && - displayDate(new Date(thread.updated).getTime())} -

-
+

+ {thread.updated && displayDate(thread.updated)} +

+

{thread.title}

{lastMessage || 'No new message'}

@@ -161,9 +157,9 @@ export default function ThreadList() {
- + Delete thread