0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-12 07:41:43 -05:00

🐛 Fix unexpected exception on workspace first initialization.

This commit is contained in:
Andrey Antukh 2019-08-12 18:20:41 +02:00
parent 8d03ff40ab
commit 5d5a7a21d2

View file

@ -76,8 +76,8 @@
(rx/cancel! shortcuts-subscription))
(mf/defc workspace
[{:keys [page wst] :as props}]
(let [flags (mf/deref refs/flags)
[{:keys [page] :as props}]
(let [flags (or (mf/deref refs/flags) #{})
canvas (mf/use-ref* nil)
left-sidebar? (not (empty? (keep flags [:layers :sitemap
@ -88,7 +88,6 @@
:no-tool-bar-right (not right-sidebar?)
:no-tool-bar-left (not left-sidebar?)
:scrolling (:viewport-positionig workspace))]
;; (prn "workspace.render")
(mf/use-effect {:deps (:id page)
:init #(subscibe canvas page)