Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamalam360 committed Nov 20, 2023
1 parent 321e304 commit 258cda4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { App, Plugin, PluginSettingTab, Setting, TFile } from "obsidian";
import { default as matter, stringify as matterStringify } from "gray-matter";

interface AutomaticTagsSettings {
tags: Record<string, string[]>;
Expand Down Expand Up @@ -33,7 +32,7 @@ export default class AutomaticTagsPlugin extends Plugin {
if (tags.length === 0) return;

await this.app.fileManager.processFrontMatter(file, (fm) => {
fm.tags = [...new Set([...fm.tags, ...tags])];
fm.tags = [...new Set([...(fm.tags || []), ...tags])];
});
}
}));
Expand Down

0 comments on commit 258cda4

Please sign in to comment.