Skip to content

Commit

Permalink
fix(WriteBCToFile): 🐛 Notice wasn't showing if MetaEdit wasn't enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
SkepticMystic committed Sep 5, 2021
1 parent a895be3 commit 649c379
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/sharedFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -613,11 +613,6 @@ export const createOrUpdateYaml = async (
frontmatter: FrontMatterCache | undefined,
api: { [fun: string]: (...args: any) => any }
) => {
if (!api) {
new Notice('Metaedit must be enabled for this function to work');
return
}

let valueStr = value.toString()

if (!frontmatter || frontmatter[key] === undefined) {
Expand All @@ -639,7 +634,12 @@ export const createOrUpdateYaml = async (
export const writeBCToFile = (app: App, plugin: BreadcrumbsPlugin, currGraphs: BCIndex, file: TFile) => {

const frontmatter = app.metadataCache.getFileCache(file)?.frontmatter;
const { api } = app.plugins.plugins.metaedit
const api = app.plugins.plugins.metaedit?.api

if (!api) {
new Notice('Metaedit must be enabled for this function to work');
return
}

currGraphs.hierGs.forEach(hier => {
DIRECTIONS.forEach(dir => {
Expand Down

0 comments on commit 649c379

Please sign in to comment.