mirror of
https://github.com/penpot/penpot.git
synced 2025-12-12 06:24:17 +01:00
🐛 Fix race condition with fix fonts patch
This commit is contained in:
committed by
Belén Albeza
parent
37e45a8bbf
commit
1b29e9a50f
@@ -76,7 +76,7 @@
|
|||||||
(map :page-id))
|
(map :page-id))
|
||||||
|
|
||||||
(defn- apply-changes-localy
|
(defn- apply-changes-localy
|
||||||
[{:keys [file-id redo-changes] :as commit} pending]
|
[{:keys [file-id redo-changes ignore-wasm?] :as commit} pending]
|
||||||
(ptk/reify ::apply-changes-localy
|
(ptk/reify ::apply-changes-localy
|
||||||
ptk/UpdateEvent
|
ptk/UpdateEvent
|
||||||
(update [_ state]
|
(update [_ state]
|
||||||
@@ -103,7 +103,7 @@
|
|||||||
pids (into #{} xf:map-page-id redo-changes)]
|
pids (into #{} xf:map-page-id redo-changes)]
|
||||||
(reduce #(ctst/update-object-indices %1 %2) fdata pids)))]
|
(reduce #(ctst/update-object-indices %1 %2) fdata pids)))]
|
||||||
|
|
||||||
(if (features/active-feature? state "render-wasm/v1")
|
(if (and (not ignore-wasm?) (features/active-feature? state "render-wasm/v1"))
|
||||||
;; Update the wasm model
|
;; Update the wasm model
|
||||||
(let [shape-changes (volatile! {})
|
(let [shape-changes (volatile! {})
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@
|
|||||||
(defn commit
|
(defn commit
|
||||||
"Create a commit event instance"
|
"Create a commit event instance"
|
||||||
[{:keys [commit-id redo-changes undo-changes origin save-undo? features
|
[{:keys [commit-id redo-changes undo-changes origin save-undo? features
|
||||||
file-id file-revn file-vern undo-group tags stack-undo? source]}]
|
file-id file-revn file-vern undo-group tags stack-undo? source ignore-wasm?]}]
|
||||||
|
|
||||||
(assert (cpc/check-changes redo-changes)
|
(assert (cpc/check-changes redo-changes)
|
||||||
"expect valid vector of changes for redo-changes")
|
"expect valid vector of changes for redo-changes")
|
||||||
@@ -147,7 +147,8 @@
|
|||||||
:save-undo? save-undo?
|
:save-undo? save-undo?
|
||||||
:undo-group undo-group
|
:undo-group undo-group
|
||||||
:tags tags
|
:tags tags
|
||||||
:stack-undo? stack-undo?}]
|
:stack-undo? stack-undo?
|
||||||
|
:ignore-wasm? ignore-wasm?}]
|
||||||
|
|
||||||
(ptk/reify ::commit
|
(ptk/reify ::commit
|
||||||
cljs.core/IDeref
|
cljs.core/IDeref
|
||||||
|
|||||||
@@ -102,7 +102,8 @@
|
|||||||
{:origin it
|
{:origin it
|
||||||
:redo-changes changes
|
:redo-changes changes
|
||||||
:undo-changes []
|
:undo-changes []
|
||||||
:save-undo? false})))))))
|
:save-undo? false
|
||||||
|
:ignore-wasm? true})))))))
|
||||||
|
|
||||||
;; FIXME: would be nice to not execute this code twice per page in the
|
;; FIXME: would be nice to not execute this code twice per page in the
|
||||||
;; same working session, maybe some local memoization can improve that
|
;; same working session, maybe some local memoization can improve that
|
||||||
@@ -119,4 +120,5 @@
|
|||||||
{:origin it
|
{:origin it
|
||||||
:redo-changes changes
|
:redo-changes changes
|
||||||
:undo-changes []
|
:undo-changes []
|
||||||
:save-undo? false})))))))
|
:save-undo? false
|
||||||
|
:ignore-wasm? true})))))))
|
||||||
|
|||||||
Reference in New Issue
Block a user