Skip to content

Commit

Permalink
isDiscourseNode should not include default defs for now (Closes #91) (#…
Browse files Browse the repository at this point in the history
…93)

* isDiscourseNode should not include default defs for now (Closes #91)

* pr feedback

* 1.7.7
  • Loading branch information
dvargas92495 authored Jun 7, 2023
1 parent 7ed67fb commit b62833e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "query-builder",
"version": "1.7.6",
"version": "1.7.7",
"description": "Introduces new user interfaces for building queries in Roam",
"main": "./build/main.js",
"author": {
Expand Down
7 changes: 5 additions & 2 deletions src/utils/isDiscourseNode.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import getDiscourseNodes from "./getDiscourseNodes";
import findDiscourseNode from "./findDiscourseNode";

const isDiscourseNode = (uid?: string, nodes = getDiscourseNodes()) =>
!!findDiscourseNode(uid, nodes);
const isDiscourseNode = (uid?: string, nodes = getDiscourseNodes()) => {
const node = findDiscourseNode(uid, nodes);
if (!node) return false;
return node.backedBy !== "default";
};

export default isDiscourseNode;

0 comments on commit b62833e

Please sign in to comment.