Skip to content

Commit

Permalink
fix: 新增校验,批量导入之前必须清除临时文件
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed May 24, 2023
1 parent febfedf commit 508999d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/i18n/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"cleanTemp": "clean up temporary files",
"clean": "Delete",
"tempCount": "temporary files",
"tempCountExists": "Please clean up the temporary files before batch import",
"supportedTypes": "Currently supported formats: .epub, .docx, .html, .opml"
}
1 change: 1 addition & 0 deletions src/i18n/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"cleanTemp": "清理临时文件,共",
"clean": "删除",
"tempCount": "个临时文件",
"tempCountExists": "请先清理临时文件在进行批量导入",
"supportedTypes": "目前支持的格式:.md, .epub, .docx, .html, .opml"
}
6 changes: 6 additions & 0 deletions src/lib/ImportForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@
// 批量转换开始
// =================
const selectFolder = async () => {
// 批量导入之前先清空临时文件
if (tempCount > 0) {
showMessage(`${pluginInstance.i18n.tempCountExists}`, 1000, "error")
return
}
const result = await window.showDirectoryPicker()
dialog.destroy()
Expand Down

0 comments on commit 508999d

Please sign in to comment.