Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

fix thread sorting issue (#5976)

cmuangsd2f99c36f54c
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<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 }