Skip to content

Commit 7c7356b

Browse files
committed
release: v0.24.1
1 parent 56c356e commit 7c7356b

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

src-tauri/tauri.conf.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "NoteGen",
4-
"version": "0.24.0",
4+
"version": "0.24.1",
55
"identifier": "com.codexu.NoteGen",
66
"build": {
77
"beforeDevCommand": "pnpm dev",
@@ -45,7 +45,7 @@
4545
"icons/icon.ico"
4646
],
4747
"iOS": {
48-
"bundleVersion": "0.24.0",
48+
"bundleVersion": "0.24.1",
4949
"developmentTeam": "RGZC4ZTJMU"
5050
},
5151
"macOS": {

src/app/core/article/file/folder-item/folder-vector-menu.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import useArticleStore, { DirTree } from "@/stores/article";
77
import { computedParentPath } from "@/lib/path";
88
import { collectMarkdownFiles } from "@/lib/files";
99
import { readTextFile, exists } from "@tauri-apps/plugin-fs";
10-
import { BaseDirectory } from "@tauri-apps/plugin-fs";
1110
import { getFilePathOptions } from "@/lib/workspace";
1211

1312
interface FolderVectorMenuProps {
@@ -16,7 +15,7 @@ interface FolderVectorMenuProps {
1615

1716
export function FolderVectorMenu({ item }: FolderVectorMenuProps) {
1817
const t = useTranslations('article.file');
19-
const { loadFileTree, checkFileVectorIndexed, clearFileVector, vectorIndexedFiles } = useArticleStore();
18+
const { loadFileTree, checkFileVectorIndexed, clearFileVector } = useArticleStore();
2019
const path = computedParentPath(item);
2120

2221
const [isCalculating, setIsCalculating] = useState(false);

src/app/core/article/file/vector-knowledge-menu.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { toast } from "@/hooks/use-toast"
66
import useArticleStore from "@/stores/article"
77
import useVectorStore from "@/stores/vector"
88
import { readTextFile } from "@tauri-apps/plugin-fs"
9-
import { computedParentPath } from "@/lib/path"
109
import { useState, useEffect } from "react"
1110
import { useTranslations } from "next-intl"
1211

@@ -21,7 +20,7 @@ interface VectorKnowledgeMenuProps {
2120

2221
export function VectorKnowledgeMenu({ item, hasVector, onVectorUpdated }: VectorKnowledgeMenuProps) {
2322
const t = useTranslations('article.file')
24-
const { vectorIndexedFiles, clearFileVector, checkFileVectorIndexed } = useArticleStore()
23+
const { clearFileVector, checkFileVectorIndexed } = useArticleStore()
2524
const [autoCalcEnabled, setAutoCalcEnabled] = useState(true)
2625
const [excludeFromKB, setExcludeFromKB] = useState(false)
2726

@@ -43,22 +42,20 @@ export function VectorKnowledgeMenu({ item, hasVector, onVectorUpdated }: Vector
4342

4443
try {
4544
// 读取文件内容
46-
const { getFilePathOptions, getWorkspacePath } = await import('@/lib/workspace')
47-
const workspace = await getWorkspacePath()
48-
const path = computedParentPath(item)
49-
const pathOptions = await getFilePathOptions(path)
45+
const { getFilePathOptions } = await import('@/lib/workspace')
46+
const pathOptions = await getFilePathOptions(item.name)
5047

5148
let content = ''
52-
if (workspace.isCustom) {
53-
content = await readTextFile(pathOptions.path)
54-
} else {
49+
if (pathOptions.baseDir) {
5550
content = await readTextFile(pathOptions.path, { baseDir: pathOptions.baseDir })
51+
} else {
52+
content = await readTextFile(pathOptions.path)
5653
}
5754

5855
// 执行向量计算
5956
const vectorStore = useVectorStore.getState()
6057
if (vectorStore.isVectorDbEnabled) {
61-
await vectorStore.processDocument(path, content)
58+
await vectorStore.processDocument(pathOptions.path, content)
6259

6360
// 更新向量索引状态
6461
await checkFileVectorIndexed(item.name)

0 commit comments

Comments
 (0)