Skip to content

Commit

Permalink
fix(Thread): janhq#1168 fix newly created thread cannot select model …
Browse files Browse the repository at this point in the history
…after restart (janhq#1176)

Signed-off-by: James <[email protected]>
Co-authored-by: James <[email protected]>
  • Loading branch information
namchuai and James authored Dec 23, 2023
1 parent f2a6e29 commit 771f445
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions web/hooks/useCreateNewThread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 771f445

Please sign in to comment.