🐛 Fix drag and drop font assets in groups

This commit is contained in:
Pablo Alba 2022-07-14 09:56:33 +02:00 committed by Andrey Antukh
parent 08c0070f22
commit 58f93d2177
3 changed files with 14 additions and 3 deletions

View file

@ -1621,6 +1621,17 @@
local-data (mf/deref typography-data)
menu-state (mf/use-state auto-pos-menu-state)
extract-path-if-missing
(fn [typography]
(let [[path name] (cph/parse-path-name (:name typography))]
(if (= (:name typography) name)
typography
(assoc typography :path path :name name))))
typographies (->> typographies
(map extract-path-if-missing))
groups (group-assets typographies reverse-sort?)
selected-typographies (:typographies selected-assets)

View file

@ -10,7 +10,6 @@
[app.common.data :as d]
[app.common.data.macros :as dm]
[app.common.exceptions :as ex]
[app.common.pages.helpers :as cph]
[app.common.text :as txt]
[app.main.data.fonts :as fts]
[app.main.data.shortcuts :as dsc]
@ -565,7 +564,7 @@
[:input.element-name.adv-typography-name
{:type "text"
:ref name-input-ref
:default-value (cph/merge-path-item (:path typography) (:name typography))
:default-value (:name typography)
:on-blur on-name-blur}]
[:div.element-set-actions-button