fix: store icon id and type only instead of full data

experiment/tanstack-table
Tienson Qin 2024-05-23 14:07:13 +08:00
parent c862ad0d10
commit 5c255210b9
4 changed files with 6 additions and 6 deletions

View File

@ -16,6 +16,8 @@
[frontend.config :as config]
[frontend.handler.property.util :as pu]))
(defonce emojis (vals (bean/->clj (gobj/get emoji-data "emojis"))))
(defn icon
[icon & [opts]]
(cond
@ -54,9 +56,6 @@
(reset! *tabler-icons result)
result)))
(defonce emojis
(vals (bean/->clj (gobj/get emoji-data "emojis"))))
(defn- search-tabler-icons
[q]
(search/fuzzy-search (get-tabler-icons) q :limit 100))

View File

@ -359,7 +359,7 @@
(db-property-handler/set-block-property!
(:db/id page)
(pu/get-pid :logseq.property/icon)
icon))
(select-keys icon [:id :type])))
:icon-props {:size 38}})
icon)])
[:h1.page-title.flex-1.cursor-pointer.gap-1

View File

@ -173,7 +173,8 @@
(re-init-commands! property)))
:update-icon
(fn [icon]
(property-handler/set-block-property! (state/get-current-repo) (:block/uuid block) :logseq.property/icon icon)))
(property-handler/set-block-property! (state/get-current-repo) (:block/uuid block) :logseq.property/icon
(select-keys icon [:id :type]))))
parent-opts))))
(rum/defc add-existing-values

View File

@ -45,7 +45,7 @@
(db-property-handler/set-block-property!
(:db/id block)
:logseq.property/icon
icon))})
(select-keys icon [:type :id])))})
(when (and icon-value (not config/publishing?))
[:a.fade-link.flex {:on-click (fn [_e]
(db-property-handler/remove-block-property!