From 6a5f2c725767ea0ab42ab126ae737bce94348877 Mon Sep 17 00:00:00 2001 From: Ross Keenan Date: Thu, 3 Feb 2022 20:32:49 +0200 Subject: [PATCH] fix(DataviewNotes): :bug: Don't run if there aren't any eligable alts --- main.js | 3 ++- src/AlternativeHierarchies/DataviewNotes.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index d61b51c3..73597d76 100644 --- a/main.js +++ b/main.js @@ -25104,8 +25104,9 @@ function addDataviewNotesToGraph(plugin, eligableAlts, frontms, mainG) { const { settings } = plugin; const { userHiers, dataviewNoteField } = settings; const dv = getDVApi(plugin); - if (!dv) { + if (!dv && eligableAlts.length) { new obsidian.Notice(DATAVIEW_MISSING); + return; } const fields = getFields(userHiers); eligableAlts.forEach((altFile) => { diff --git a/src/AlternativeHierarchies/DataviewNotes.ts b/src/AlternativeHierarchies/DataviewNotes.ts index e0faea08..94303c38 100644 --- a/src/AlternativeHierarchies/DataviewNotes.ts +++ b/src/AlternativeHierarchies/DataviewNotes.ts @@ -21,8 +21,9 @@ export function addDataviewNotesToGraph( const { settings } = plugin; const { userHiers, dataviewNoteField } = settings; const dv = getDVApi(plugin); - if (!dv) { + if (!dv && eligableAlts.length) { new Notice(DATAVIEW_MISSING); + return; } const fields = getFields(userHiers);