🐛 Fix ungroup typography when editing

This commit is contained in:
Eva 2022-02-10 13:51:07 +01:00 committed by Andrés Moya
parent 5a5222a97a
commit 03242e1a9c
3 changed files with 7 additions and 6 deletions

View file

@ -245,9 +245,7 @@
(ptk/reify ::update-typography
ptk/WatchEvent
(watch [it state _]
(let [[path name] (cph/parse-path-name (:name typography))
typography (assoc typography :path path :name name)
prev (get-in state [:workspace-data :typographies (:id typography)])
(let [prev (get-in state [:workspace-data :typographies (:id typography)])
rchg {:type :mod-typography
:typography typography}
uchg {:type :mod-typography

View file

@ -471,7 +471,8 @@
(fn [event]
(let [content (dom/get-target-val event)]
(when-not (str/blank? content)
(on-change {:name content})))))
(let [[path name] (cph/parse-path-name content)]
(on-change {:name name :path path}))))))
handle-go-to-edit
(fn []
@ -510,8 +511,9 @@
(let [content (mf/ref-val name-ref)]
;; On destroy we check if it changed
(when (and (some? content) (not= content (:name typography)))
(let [{:keys [on-change]} (mf/ref-val on-change-ref)]
(on-change {:name content})))))))
(let [{:keys [on-change]} (mf/ref-val on-change-ref)
[path name] (cph/parse-path-name content)]
(on-change {:name name :path path})))))))
[:*
[:div.element-set-options-group.typography-entry