mirror of
https://github.com/penpot/penpot.git
synced 2025-05-23 02:16:14 +02:00
Better workespace state re/initialization.
This commit is contained in:
parent
1aa236e812
commit
0a70ab9c8c
1 changed files with 19 additions and 17 deletions
|
@ -50,23 +50,25 @@
|
||||||
(defrecord InitializeWorkspace [project page]
|
(defrecord InitializeWorkspace [project page]
|
||||||
ptk/UpdateEvent
|
ptk/UpdateEvent
|
||||||
(update [_ state]
|
(update [_ state]
|
||||||
(if (:workspace state)
|
(let [default-flags #{:sitemap :drawtools :layers :element-options :rules :ruler}]
|
||||||
(update state :workspace merge
|
(if (:workspace state)
|
||||||
{:project project
|
(update state :workspace merge
|
||||||
:page page
|
{:project project
|
||||||
:selected #{}
|
:page page
|
||||||
:drawing nil
|
:selected #{}
|
||||||
:drawing-tool nil
|
:flags default-flags
|
||||||
:tooltip nil})
|
:drawing nil
|
||||||
(assoc state :workspace
|
:drawing-tool nil
|
||||||
{:project project
|
:tooltip nil})
|
||||||
:zoom 1
|
(assoc state :workspace
|
||||||
:page page
|
{:project project
|
||||||
:flags #{:sitemap :drawtools :layers :element-options :rules}
|
:zoom 1
|
||||||
:selected #{}
|
:page page
|
||||||
:drawing nil
|
:flags default-flags
|
||||||
:drawing-tool nil
|
:selected #{}
|
||||||
:tooltip nil})))
|
:drawing nil
|
||||||
|
:drawing-tool nil
|
||||||
|
:tooltip nil}))))
|
||||||
|
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ state s]
|
(watch [_ state s]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue