mirror of
https://github.com/jxpeng98/obsidian-to-NotionNext
synced 2026-07-31 18:18:36 +08:00
Fixed tags
This commit is contained in:
9
main.ts
9
main.ts
@@ -99,15 +99,8 @@ export default class ObsidianSyncNotionPlugin extends Plugin {
|
|||||||
const nowFile = app.workspace.getActiveFile();
|
const nowFile = app.workspace.getActiveFile();
|
||||||
const { allowTags } = this.settings;
|
const { allowTags } = this.settings;
|
||||||
let tags = []
|
let tags = []
|
||||||
let fileTags = app.metadataCache.getFileCache(nowFile)?.frontmatter?.tags;
|
|
||||||
console.log(nowFile, fileTags)
|
|
||||||
console.log(app.metadataCache.getFileCache(nowFile))
|
|
||||||
if(allowTags && !fileTags) {
|
|
||||||
new Notice(langConfig["set-tags-fail"]);
|
|
||||||
return
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
if (app.metadataCache.getFileCache(nowFile).tags !== undefined && allowTags) {
|
if(allowTags) {
|
||||||
tags = app.metadataCache.getFileCache(nowFile).frontmatter.tags;
|
tags = app.metadataCache.getFileCache(nowFile).frontmatter.tags;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user