mirror of
https://github.com/penpot/penpot.git
synced 2025-06-06 04:21:39 +02:00
🐛 Fix race condition on lentes (update deps).
This commit is contained in:
parent
dc9fc5e5a9
commit
ebc76849b7
5 changed files with 21 additions and 34 deletions
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
funcool/beicon {:mvn/version "6.0.0-SNAPSHOT"}
|
funcool/beicon {:mvn/version "6.0.0-SNAPSHOT"}
|
||||||
funcool/cuerdas {:mvn/version "2.2.0"}
|
funcool/cuerdas {:mvn/version "2.2.0"}
|
||||||
funcool/lentes {:mvn/version "1.3.3"}
|
funcool/lentes {:mvn/version "1.4.0-SNAPSHOT"}
|
||||||
funcool/potok {:mvn/version "2.8.0-SNAPSHOT"}
|
funcool/potok {:mvn/version "2.8.0-SNAPSHOT"}
|
||||||
funcool/promesa {:mvn/version "4.0.2"}
|
funcool/promesa {:mvn/version "4.0.2"}
|
||||||
funcool/rumext {:mvn/version "2.0.0-SNAPSHOT"}
|
funcool/rumext {:mvn/version "2.0.0-SNAPSHOT"}
|
||||||
|
|
|
@ -282,6 +282,17 @@
|
||||||
(assoc :workspace-layout default-layout)
|
(assoc :workspace-layout default-layout)
|
||||||
(assoc :workspace-local local))))))
|
(assoc :workspace-local local))))))
|
||||||
|
|
||||||
|
(defn finalize
|
||||||
|
[file-id page-id]
|
||||||
|
(s/assert ::us/uuid file-id)
|
||||||
|
(s/assert ::us/uuid page-id)
|
||||||
|
(ptk/reify ::initialized
|
||||||
|
ptk/UpdateEvent
|
||||||
|
(update [_ state]
|
||||||
|
(dissoc state
|
||||||
|
:workspace-page
|
||||||
|
:workspace-data))))
|
||||||
|
|
||||||
(defn initialize-page
|
(defn initialize-page
|
||||||
[page-id]
|
[page-id]
|
||||||
(ptk/reify ::initialize-page
|
(ptk/reify ::initialize-page
|
||||||
|
@ -291,12 +302,7 @@
|
||||||
data (get-in state [:pages-data page-id])]
|
data (get-in state [:pages-data page-id])]
|
||||||
(assoc state
|
(assoc state
|
||||||
:workspace-data data
|
:workspace-data data
|
||||||
:workspace-page page)))
|
:workspace-page page)))))
|
||||||
|
|
||||||
ptk/EffectEvent
|
|
||||||
(effect [_ state stream]
|
|
||||||
;; TODO: emit join page event
|
|
||||||
)))
|
|
||||||
|
|
||||||
;; --- Fetch Workspace Users
|
;; --- Fetch Workspace Users
|
||||||
|
|
||||||
|
@ -728,7 +734,6 @@
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ state stream]
|
(watch [_ state stream]
|
||||||
(let [change (::tmp-change state)]
|
(let [change (::tmp-change state)]
|
||||||
(prn "update-shape" change)
|
|
||||||
(rx/of (commit-shapes-changes [change])
|
(rx/of (commit-shapes-changes [change])
|
||||||
#(dissoc state ::tmp-change))))))
|
#(dissoc state ::tmp-change))))))
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
[uxbox.main.constants :as c]
|
[uxbox.main.constants :as c]
|
||||||
[uxbox.main.store :as st]))
|
[uxbox.main.store :as st]))
|
||||||
|
|
||||||
|
|
||||||
(def profile
|
(def profile
|
||||||
(-> (l/key :profile)
|
(-> (l/key :profile)
|
||||||
(l/derive st/state)))
|
(l/derive st/state)))
|
||||||
|
|
|
@ -93,35 +93,19 @@
|
||||||
(when right-sidebar?
|
(when right-sidebar?
|
||||||
[:& right-sidebar {:page page :layout layout}])]))
|
[:& right-sidebar {:page page :layout layout}])]))
|
||||||
|
|
||||||
(mf/defc workspace-page
|
|
||||||
[{:keys [file-id page-id layout file flags] :as props}]
|
|
||||||
(let [page (mf/deref refs/workspace-page)]
|
|
||||||
[:> rdnd/provider {:backend rdnd/html5}
|
|
||||||
[:& messages-widget]
|
|
||||||
[:& header {:page page :layout layout :flags flags}]
|
|
||||||
|
|
||||||
(when (:colorpalette layout)
|
|
||||||
[:& colorpalette])
|
|
||||||
|
|
||||||
(when (and layout page)
|
|
||||||
[:& workspace-content {:layout layout
|
|
||||||
:flags flags
|
|
||||||
:file file
|
|
||||||
:page page}])]))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(mf/defc workspace
|
(mf/defc workspace
|
||||||
[{:keys [file-id page-id] :as props}]
|
[{:keys [file-id page-id] :as props}]
|
||||||
(mf/use-effect
|
(mf/use-effect
|
||||||
{:deps (mf/deps file-id page-id)
|
{:deps (mf/deps file-id page-id)
|
||||||
:fn #(st/emit! (dw/initialize file-id page-id))})
|
|
||||||
|
|
||||||
(mf/use-effect
|
|
||||||
{:deps (mf/deps file-id)
|
|
||||||
:fn (fn []
|
:fn (fn []
|
||||||
(st/emit! (dw/initialize-ws file-id))
|
(st/emit! (dw/initialize file-id page-id))
|
||||||
#(st/emit! (dw/finalize-ws file-id)))})
|
#(st/emit! (dw/finalize file-id page-id)))})
|
||||||
|
|
||||||
|
;; (mf/use-effect
|
||||||
|
;; {:deps (mf/deps file-id)
|
||||||
|
;; :fn (fn []
|
||||||
|
;; (st/emit! (dw/initialize-ws file-id))
|
||||||
|
;; #(st/emit! (dw/finalize-ws file-id)))})
|
||||||
|
|
||||||
;; (mf/use-effect
|
;; (mf/use-effect
|
||||||
;; {:deps (mf/deps file-id page-id)
|
;; {:deps (mf/deps file-id page-id)
|
||||||
|
|
|
@ -258,7 +258,6 @@
|
||||||
(events/unlistenByKey key1)
|
(events/unlistenByKey key1)
|
||||||
(events/unlistenByKey key2))))]
|
(events/unlistenByKey key2))))]
|
||||||
(mf/use-effect on-mount)
|
(mf/use-effect on-mount)
|
||||||
;; (prn "viewport$render")
|
|
||||||
[:*
|
[:*
|
||||||
[:& coordinates {:zoom zoom}]
|
[:& coordinates {:zoom zoom}]
|
||||||
[:svg.viewport {:width (* c/viewport-width zoom)
|
[:svg.viewport {:width (* c/viewport-width zoom)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue