Compare commits

...

1 Commits

Author SHA1 Message Date
Eva Marco
80920d320d 🐛 Add notification to token applied during text edition 2026-02-23 08:57:47 +01:00
2 changed files with 13 additions and 4 deletions

View File

@@ -620,7 +620,7 @@
ptk/WatchEvent
(watch [_ state _]
;; We do not allow to apply tokens while text editor is open.
(when (empty? (get state :workspace-editor-state))
(if (empty? (get state :workspace-editor-state))
(let [attributes-to-remove
;; Remove atomic typography tokens when applying composite and vice-verca
(cond
@@ -674,7 +674,11 @@
(if (rx/observable? res)
res
(rx/of res))))
(rx/of (dwu/commit-undo-transaction undo-id)))))))))))))
(rx/of (dwu/commit-undo-transaction undo-id)))))))))
(rx/of (ntf/show {:content "patata"
:type :toast
:level :warning
:timeout 3000}))))))
(defn apply-spacing-token-separated
"Handles edge-case for spacing token when applying token via toggle button.

View File

@@ -12,6 +12,7 @@
[app.common.data.macros :as dm]
[app.common.types.tokens-lib :as ctob]
[app.main.data.modal :as modal]
[app.main.data.notifications :as ntf]
[app.main.data.workspace.tokens.application :as dwta]
[app.main.data.workspace.tokens.library-edit :as dwtl]
[app.main.refs :as refs]
@@ -136,9 +137,13 @@
(fn [event token]
(let [token (ctob/get-token tokens-lib selected-token-set-id (:id token))]
(dom/stop-propagation event)
(when (and not-editing? (seq selected-shapes) (not= (:type token) :number))
(if (and not-editing? (seq selected-shapes) (not= (:type token) :number))
(st/emit! (dwta/toggle-token {:token token
:shape-ids selected-ids}))))))]
:shape-ids selected-ids}))
(st/emit! (ntf/show {:content "patata"
:type :toast
:level :warning
:timeout 3000}))))))]
[:div {:class (stl/css :token-section-wrapper)
:data-testid (dm/str "section-" (name type))}