From a67b0a81f4bec4fcffb6ef8dbd73231d46f7f1c4 Mon Sep 17 00:00:00 2001 From: Jaeseok Lee Date: Tue, 4 Mar 2025 09:20:30 +0900 Subject: [PATCH] fix: check dataview enabled correctly even if lazy loaded --- src/conversion/compiler/dataview.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/conversion/compiler/dataview.ts b/src/conversion/compiler/dataview.ts index ea79bc28..7b44d07b 100644 --- a/src/conversion/compiler/dataview.ts +++ b/src/conversion/compiler/dataview.ts @@ -14,7 +14,6 @@ import { Component, type FrontMatterCache, htmlToMarkdown, TFile } from "obsidia import { type DataviewApi, getAPI, - isPluginEnabled, type Literal, } from "obsidian-dataview"; import { @@ -187,8 +186,8 @@ export async function convertDataviewQueries( const settings = plugin.settings; let replacedText = text; const dataViewRegex = /```dataview\s(.+?)```/gms; - const isDataviewEnabled = app.plugins.plugins.dataview; - if (!isDataviewEnabled || !isPluginEnabled(app)) return replacedText; + const isDataviewEnabled = app.plugins.plugins?.dataview?._loaded; + if (!isDataviewEnabled) return replacedText; const dvApi = getAPI(app); if (!dvApi) return replacedText; const matches = text.matchAll(dataViewRegex);