0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-20 05:34:23 -05:00

♻ Allow token set grouping - Remove slash to dash conversion

This commit is contained in:
Florian Schroedl 2024-11-05 15:48:37 +01:00
parent 3c5c9a8e14
commit 7044c17d89
2 changed files with 3 additions and 11 deletions

View file

@ -200,13 +200,9 @@
context]
:as _props}]
(let [{:keys [editing? new? on-edit on-create on-reset] :as ctx} (or context (sets-context/use-context))
avoid-token-set-grouping #(str/replace % "/" "-")
submit-token
#(do
;; TODO: We don't support set grouping for now so we rename sets for now
(when (str/includes? (:name %) "/")
(warn-on-try-create-token-set-group!))
(on-create-token-set (update % :name avoid-token-set-grouping))
(on-create-token-set %)
(on-reset))]
[:ul {:class (stl/css :sets-list)}
(if (and
@ -218,10 +214,7 @@
(when token-set
(let [update-token
#(do
;; TODO: We don't support set grouping for now so we rename sets for now
(when (str/includes? (:name %) "/")
(warn-on-try-create-token-set-group!))
(on-update-token-set (avoid-token-set-grouping (:name token-set)) (update % :name avoid-token-set-grouping))
(on-update-token-set (:name token-set) %)
(on-reset))]
[:& sets-tree
{:key (:name token-set)

View file

@ -182,8 +182,7 @@
(->> data-stream
(rx/map (fn [data]
(try
(-> (str/replace data "/" "-") ;; TODO Remove when token groups work
(t/decode-str))
(t/decode-str data)
(catch js/Error e
(throw (wte/error-ex-info :error.import/json-parse-error data e))))))
(rx/map (fn [json-data]