mirror of
https://github.com/penpot/penpot.git
synced 2025-02-10 17:18:21 -05:00
Improve workspace initialization.
This commit is contained in:
parent
9d19acfeb3
commit
fd6395fcd4
1 changed files with 13 additions and 7 deletions
|
@ -59,16 +59,22 @@
|
|||
|
||||
(defn initialize
|
||||
"Initialize the workspace state."
|
||||
[projectid pageid]
|
||||
[project page]
|
||||
(reify
|
||||
rs/UpdateEvent
|
||||
(-apply-update [_ state]
|
||||
(let [s {:project projectid
|
||||
:flags #{:layers :element-options}
|
||||
:drawing nil
|
||||
:selected #{}
|
||||
:page pageid}]
|
||||
(assoc state :workspace s)))))
|
||||
(if-let [workspace (:workspace state)]
|
||||
(update state :workspace merge
|
||||
{:project project
|
||||
:page page
|
||||
:selected #{}
|
||||
:drawing nil})
|
||||
(update state :workspace merge
|
||||
{:project project
|
||||
:page page
|
||||
:flags #{:layers :element-options}
|
||||
:selected #{}
|
||||
:drawing nil})))))
|
||||
|
||||
(defn toggle-flag
|
||||
"Toggle the enabled flag of the specified tool."
|
||||
|
|
Loading…
Add table
Reference in a new issue