mirror of
https://github.com/jxpeng98/obsidian-to-NotionNext
synced 2026-07-29 16:35:57 +08:00
success status
This commit is contained in:
7
main.ts
7
main.ts
@@ -80,13 +80,13 @@ export default class ObsidianSyncNotionPlugin extends Plugin {
|
||||
);
|
||||
return;
|
||||
}
|
||||
const { markDownData, nowFile, tags, type, slug } =await this.getNowFileMarkdownContent(this.app);
|
||||
const { markDownData, nowFile, tags, type, slug, stats } =await this.getNowFileMarkdownContent(this.app);
|
||||
|
||||
|
||||
if (markDownData) {
|
||||
const { basename } = nowFile;
|
||||
const upload = new Upload2Notion(this);
|
||||
const res = await upload.syncMarkdownToNotion(basename, allowTags, tags, type, slug, markDownData, nowFile, this.app, this.settings)
|
||||
const res = await upload.syncMarkdownToNotion(basename, allowTags, tags, type, slug, stats, markDownData, nowFile, this.app, this.settings)
|
||||
if(res.status === 200){
|
||||
new Notice(`${langConfig["sync-success"]}${basename}`)
|
||||
}else {
|
||||
@@ -101,6 +101,7 @@ export default class ObsidianSyncNotionPlugin extends Plugin {
|
||||
let tags = []
|
||||
let type = ''
|
||||
let slug = ''
|
||||
let stats = ''
|
||||
|
||||
const FileCache = app.metadataCache.getFileCache(nowFile)
|
||||
try {
|
||||
@@ -108,6 +109,7 @@ export default class ObsidianSyncNotionPlugin extends Plugin {
|
||||
tags = FileCache.frontmatter.tags;
|
||||
type = FileCache.frontmatter.type;
|
||||
slug = FileCache.frontmatter.slug;
|
||||
stats = FileCache.frontmatter.stats;
|
||||
}
|
||||
} catch (error) {
|
||||
new Notice(langConfig["set-tags-fail"]);
|
||||
@@ -120,6 +122,7 @@ export default class ObsidianSyncNotionPlugin extends Plugin {
|
||||
tags,
|
||||
type,
|
||||
slug,
|
||||
stats,
|
||||
};
|
||||
} else {
|
||||
new Notice(langConfig["open-file"]);
|
||||
|
||||
Reference in New Issue
Block a user