mirror of
https://github.com/penpot/penpot.git
synced 2025-07-23 01:27:13 +02:00
🐛 Fix parsing pending callback on setting single shape attr
This commit is contained in:
parent
f02dd9f8dc
commit
330bee7839
1 changed files with 8 additions and 5 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
(ns app.render-wasm.shape
|
||||
(:require
|
||||
[app.common.data :as d]
|
||||
[app.common.data.macros :as dm]
|
||||
[app.common.transit :as t]
|
||||
[app.common.types.shape :as shape]
|
||||
|
@ -206,12 +207,13 @@
|
|||
(defn set-wasm-multi-attrs!
|
||||
[shape properties]
|
||||
(api/use-shape (:id shape))
|
||||
(let [pending
|
||||
(let [result
|
||||
(->> properties
|
||||
(mapcat #(set-wasm-single-attr! shape %)))]
|
||||
(mapcat #(set-wasm-single-attr! shape %)))
|
||||
pending (-> (d/index-by :key :callback result) vals)]
|
||||
(if (and pending (seq pending))
|
||||
(->> (rx/from pending)
|
||||
(rx/mapcat identity)
|
||||
(rx/mapcat (fn [callback] (callback)))
|
||||
(rx/reduce conj [])
|
||||
(rx/subs!
|
||||
(fn [_]
|
||||
|
@ -226,11 +228,12 @@
|
|||
[shape k v]
|
||||
(let [shape (assoc shape k v)]
|
||||
(api/use-shape (:id shape))
|
||||
(let [pending (set-wasm-single-attr! shape k)]
|
||||
(let [result (set-wasm-single-attr! shape k)
|
||||
pending (-> (d/index-by :key :callback result) vals)]
|
||||
;; TODO: set-wasm-attrs is called twice with every set
|
||||
(if (and pending (seq pending))
|
||||
(->> (rx/from pending)
|
||||
(rx/mapcat identity)
|
||||
(rx/mapcat (fn [callback] (callback)))
|
||||
(rx/reduce conj [])
|
||||
(rx/subs!
|
||||
(fn [_]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue