From d2f99c36f54cef9dc0f93204ac3642aaf4ab0773 Mon Sep 17 00:00:00 2001 From: cmuangs Date: Wed, 30 Jul 2025 19:15:29 +0800 Subject: [PATCH] fix thread sorting issue (#5976) --- web-app/src/hooks/useThreads.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web-app/src/hooks/useThreads.ts b/web-app/src/hooks/useThreads.ts index c9e88d097..140972720 100644 --- a/web-app/src/hooks/useThreads.ts +++ b/web-app/src/hooks/useThreads.ts @@ -103,6 +103,7 @@ export const useThreads = create()((set, get) => ({ [threadId]: { ...state.threads[threadId], isFavorite: !state.threads[threadId].isFavorite, + updated: Date.now() / 1000, }, }, } @@ -221,6 +222,7 @@ export const useThreads = create()((set, get) => ({ [state.currentThreadId as string]: { ...state.threads[state.currentThreadId as string], assistants: [assistant], + updated: Date.now() / 1000, }, }, } @@ -249,6 +251,7 @@ export const useThreads = create()((set, get) => ({ const updatedThread = { ...thread, title: newTitle, + updated: Date.now() / 1000, } updateThread(updatedThread) // External call, order is fine const newThreads = { ...state.threads, [threadId]: updatedThread }