Skip to content

Commit

Permalink
pref: support searching main session's messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ourongxing committed Jun 15, 2023
1 parent 11d5fee commit 73228f9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ export function loadSession(id: string) {
}
})
setTimeout(() => {
FZFData.sessionOptions = fetchAllSessions()
const seesions = fetchAllSessions()
FZFData.sessionOptions = seesions
.sort((m, n) => n.lastVisit - m.lastVisit)
.filter(k => k.id !== store.sessionId && k.id !== "index")
.map(k => ({
Expand All @@ -269,7 +270,12 @@ export function loadSession(id: string) {
if (id !== "index") {
FZFData.sessionOptions.unshift({
title: "回到主对话",
desc: "其实点击顶部 Logo 也可以直接回到主对话",
desc:
"其实点击顶部 Logo 也可以直接回到主对话。" +
seesions
.find(k => k.id === "index")
?.messages.map(k => k.content)
.join("\n") ?? "",
extra: {
id: "index"
}
Expand Down

0 comments on commit 73228f9

Please sign in to comment.