fix thread sorting issue (#5976)
This commit is contained in:
parent
12c552c987
commit
d2f99c36f5
@ -103,6 +103,7 @@ export const useThreads = create<ThreadState>()((set, get) => ({
|
||||
[threadId]: {
|
||||
...state.threads[threadId],
|
||||
isFavorite: !state.threads[threadId].isFavorite,
|
||||
updated: Date.now() / 1000,
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -221,6 +222,7 @@ export const useThreads = create<ThreadState>()((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<ThreadState>()((set, get) => ({
|
||||
const updatedThread = {
|
||||
...thread,
|
||||
title: newTitle,
|
||||
updated: Date.now() / 1000,
|
||||
}
|
||||
updateThread(updatedThread) // External call, order is fine
|
||||
const newThreads = { ...state.threads, [threadId]: updatedThread }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user