Skip to content

Commit d2f99c3

Browse files
authored
fix thread sorting issue (#5976)
1 parent 12c552c commit d2f99c3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

web-app/src/hooks/useThreads.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ export const useThreads = create<ThreadState>()((set, get) => ({
103103
[threadId]: {
104104
...state.threads[threadId],
105105
isFavorite: !state.threads[threadId].isFavorite,
106+
updated: Date.now() / 1000,
106107
},
107108
},
108109
}
@@ -221,6 +222,7 @@ export const useThreads = create<ThreadState>()((set, get) => ({
221222
[state.currentThreadId as string]: {
222223
...state.threads[state.currentThreadId as string],
223224
assistants: [assistant],
225+
updated: Date.now() / 1000,
224226
},
225227
},
226228
}
@@ -249,6 +251,7 @@ export const useThreads = create<ThreadState>()((set, get) => ({
249251
const updatedThread = {
250252
...thread,
251253
title: newTitle,
254+
updated: Date.now() / 1000,
252255
}
253256
updateThread(updatedThread) // External call, order is fine
254257
const newThreads = { ...state.threads, [threadId]: updatedThread }

0 commit comments

Comments
 (0)