Skip to content

Commit 46c43e5

Browse files
committed
Merge branch 'main' of github.com:terwer/siyuan-plugin-importer into dev
2 parents 6325921 + 69ca57a commit 46c43e5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/lib/ImportForm.svelte

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
let notebooks = []
3939
let toNotebookId
4040
let toNotebookName
41+
//用户指南不应该作为可以写入的笔记本
42+
const hiddenNotebook: Set<string> = new Set(["思源笔记用户指南", "SiYuan User Guide"]);
4143
4244
const startImport = async (
4345
event: InputEvent & {
@@ -153,6 +155,10 @@
153155
const res = await pluginInstance.kernelApi.lsNotebooks()
154156
const data = res.data as any
155157
notebooks = data.notebooks ?? []
158+
//没有必要把所有笔记本都列出来
159+
notebooks = notebooks.filter(
160+
notebook => !notebook.closed && !hiddenNotebook.has(notebook.name)
161+
);
156162
// 选中,若是没保存,获取第一个
157163
toNotebookId = importerConfig?.notebook ?? notebooks[0].id
158164
const currentNotebook = notebooks.find((n) => n.id === toNotebookId)

0 commit comments

Comments
 (0)