0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-10 00:58:26 -05:00

🐛 Fixes problem with left sidebar

This commit is contained in:
alonso.torres 2020-09-16 14:20:19 +02:00 committed by Andrey Antukh
parent 8396357f36
commit 09c8920293
2 changed files with 8 additions and 20 deletions

View file

@ -86,11 +86,6 @@
(s/def ::options-mode #{:design :prototype})
(def workspace-file-local-default
{:left-sidebar? true
:right-sidebar? true
:color-for-rename nil})
(def workspace-local-default
{:zoom 1
:flags #{}
@ -123,8 +118,7 @@
ptk/UpdateEvent
(update [_ state]
(assoc state
:workspace-presence {}
:workspace-file-local workspace-file-local-default))
:workspace-presence {}))
ptk/WatchEvent
(watch [_ state stream]
@ -373,9 +367,9 @@
:document-history
:assets])))
right-sidebar? (not (empty? (keep layout [:element-options])))]
(update-in state [:workspace-local]
assoc :left-sidebar? left-sidebar?
:right-sidebar? right-sidebar?)))
(update state :workspace-local
assoc :left-sidebar? left-sidebar?
:right-sidebar? right-sidebar?)))
(defn- check-auto-flags
[state flags-to-toggle]
@ -401,8 +395,8 @@
ptk/UpdateEvent
(update [_ state]
(-> (reduce toggle-layout-flag state flags)
(check-sidebars)
(check-auto-flags flags)))))
(check-auto-flags flags)
(check-sidebars)))))
;; --- Set element options mode

View file

@ -40,18 +40,12 @@
;; ---- Workspace refs
;; (def workspace-local
;; (l/derived :workspace-local st/state))
(def workspace-local
(l/derived :workspace-local st/state))
(def workspace-drawing
(l/derived :workspace-drawing st/state))
(def workspace-local
(l/derived (fn [state]
(merge (:workspace-local state)
(:workspace-file-local state)))
st/state =))
(def selected-shapes
(l/derived :selected workspace-local))