fix(Thread): #1168 fix newly created thread cannot select model after restart (#1176)

Signed-off-by: James <james@jan.ai>
Co-authored-by: James <james@jan.ai>
This commit is contained in:
NamH 2023-12-23 11:16:58 +07:00 committed by GitHub
parent f2a6e2951e
commit 771f445a6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -103,9 +103,13 @@ export const useCreateNewThread = () => {
function updateThreadMetadata(thread: Thread) {
updateThread(thread)
extensionManager
.get<ConversationalExtension>(ExtensionType.Conversational)
?.saveThread(thread)
const threadState = threadStates[thread.id]
const isFinishInit = threadState?.isFinishInit ?? true
if (isFinishInit) {
extensionManager
.get<ConversationalExtension>(ExtensionType.Conversational)
?.saveThread(thread)
}
}
return {