Skip to content

Commit

Permalink
fix(scan): update error prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
aidenlx committed Aug 31, 2021
1 parent 69cd000 commit 33e8312
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/modules/scan.ts
@@ -1,6 +1,7 @@
import { MbBookNote } from "@alx-plugins/marginnote";

import { Note, Toc } from "../return";
import getText from "./translate";
import { RequiredKeys } from "./type-tools";

/**
Expand All @@ -24,7 +25,8 @@ export const scanToc = (note: MbBookNote): [note: Toc, bookMd5s: string[]] => {
if (
requiredKeys.some((k) => {
const result = obj[k] === null || obj[k] === undefined;
if (result) invaild.push(`${obj.noteTitle} missing prop ${k}`);
if (result)
invaild.push(`${obj.noteId} ${getText("missing_param")}: ${k}`);
return result;
})
)
Expand Down
1 change: 1 addition & 0 deletions src/modules/translate.ts
Expand Up @@ -23,6 +23,7 @@ const text = {
toc: ["获取目录模式", "TOC Fetch Mode"],
addon: ["Obsidian Bridge", "Obsidian Bridge"],
cancel: ["取消", "Cancel"],
missing_param: ["笔记缺少参数", "Missing params"],
};

const getLanguage = () =>
Expand Down

0 comments on commit 33e8312

Please sign in to comment.