🐛 Fix race condition with fix fonts patch

This commit is contained in:
alonso.torres
2025-12-02 17:41:51 +01:00
committed by Belén Albeza
parent 37e45a8bbf
commit 1b29e9a50f
2 changed files with 9 additions and 6 deletions

View File

@@ -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

View File

@@ -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})))))))