From 00e9677dedb6a6686cf93290350297de207d140b Mon Sep 17 00:00:00 2001 From: Michael Gartner Date: Wed, 19 Feb 2025 19:57:15 -0600 Subject: [PATCH 1/2] Fix user display name retrieval with optional chaining and filtering --- src/utils/conditionToDatalog.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/conditionToDatalog.ts b/src/utils/conditionToDatalog.ts index f76bdfd..2453756 100644 --- a/src/utils/conditionToDatalog.ts +++ b/src/utils/conditionToDatalog.ts @@ -571,7 +571,8 @@ const translator: Record = { `[:find (pull ?n [:node/title]) :where [?u :user/display-page ?n]]` ) as [PullBlock][] ) - .map((d) => d[0][":node/title"] || "") + .map((d) => d[0]?.[":node/title"] || "") + .filter(Boolean) .concat(["{current user}"]), placeholder: "Enter the display name of any user with access to this graph", }, @@ -601,7 +602,8 @@ const translator: Record = { `[:find (pull ?n [:node/title]) :where [?u :user/display-page ?n]]` ) as [PullBlock][] ) - .map((d) => d[0][":node/title"] || "") + .map((d) => d[0]?.[":node/title"] || "") + .filter(Boolean) .concat(["{current user}"]), placeholder: "Enter the display name of any user with access to this graph", }, From d6fd8ecbdf5c760211669593b6d480b153929576 Mon Sep 17 00:00:00 2001 From: Michael Gartner Date: Wed, 19 Feb 2025 19:58:09 -0600 Subject: [PATCH 2/2] 1.34.3 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index c89509c..af0a77c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "query-builder", - "version": "1.34.2", + "version": "1.34.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "query-builder", - "version": "1.34.2", + "version": "1.34.3", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index a79f64e..4852f5a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "query-builder", - "version": "1.34.2", + "version": "1.34.3", "description": "Introduces new user interfaces for building queries in Roam", "main": "./build/main.js", "author": {