Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
tiensonqin committed Jan 15, 2025
1 parent 1d9fbc8 commit bd96226
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
32 changes: 21 additions & 11 deletions deps/db/src/logseq/db/frontend/entity_plus.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,25 @@
(lookup-entity property :logseq.property/scalar-default-value nil)
(lookup-entity property :logseq.property/default-value nil)))))))))

(defn- get-property-keys
[^Entity e]
(let [db (.-db e)]
(if (db-based-graph? db)
(->> (map :a (d/datoms db :eavt (.-eid e)))
distinct
(filter db-property/property?))
(keys (lookup-entity e :block/properties nil)))))

(defn- get-properties
[^Entity e]
(let [db (.-db e)]
(if (db-based-graph? db)
(lookup-entity e :block/properties
(->> (into {} e)
(filter (fn [[k _]] (db-property/property? k)))
(into {})))
(lookup-entity e :block/properties nil))))

;; (defonce *id->k-frequency (atom {}))
(defn lookup-kv-then-entity
([e k] (lookup-kv-then-entity e k nil))
Expand All @@ -134,19 +153,10 @@
(lookup-entity e :block/title default-value))

:block/properties
(if (db-based-graph? db)
(lookup-entity e :block/properties
(->> (into {} e)
(filter (fn [[k _]] (db-property/property? k)))
(into {})))
(lookup-entity e :block/properties nil))
(get-properties e)

:block.temp/property-keys
(if (db-based-graph? db)
(->> (map :a (d/datoms db :eavt (.-eid e)))
distinct
(filter db-property/property?))
(keys (lookup-entity e :block/properties nil)))
(get-property-keys e)

;; cache :block/title
:block/title
Expand Down
1 change: 0 additions & 1 deletion src/main/frontend/handler/editor.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
(:require [clojure.set :as set]
[clojure.string :as string]
[clojure.walk :as w]
[datascript.core :as d]
[dommy.core :as dom]
[frontend.commands :as commands]
[frontend.config :as config]
Expand Down

0 comments on commit bd96226

Please sign in to comment.