From f108c33295221fa194f75dc3d226c21e8ccba96c Mon Sep 17 00:00:00 2001 From: halfjuice Date: Wed, 15 Oct 2025 16:20:37 -0700 Subject: [PATCH] Fix inline JS rendering when there is await Fix use case like `$=await dv.view('...')` which is currently returning empty --- src/ui/lp-render.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ui/lp-render.ts b/src/ui/lp-render.ts index 4b384a20..035481ae 100644 --- a/src/ui/lp-render.ts +++ b/src/ui/lp-render.ts @@ -330,11 +330,13 @@ export function inlinePlugin(app: App, index: FullIndex, settings: DataviewSetti try { // for setting the correct context for dv/dataview const myEl = createDiv(); - const dvInlineApi = new DataviewInlineApi(api, this.component, myEl, currentFile.path); + const dvInlineApi = new DataviewInlineApi(api, this.component, code.includes("await") ? el : myEl, currentFile.path); if (code.includes("await")) { (evalInContext("(async () => { " + PREAMBLE + code + " })()") as Promise).then( (result: any) => { - renderValue(app, result, el, currentFile.path, this.component, settings); + if (result) { + renderValue(app, result, el, currentFile.path, this.component, settings); + } } ); } else {