mirror of
https://github.com/penpot/penpot.git
synced 2025-06-05 09:21:39 +02:00
🐛 Fixes problem with left sidebar
This commit is contained in:
parent
8396357f36
commit
09c8920293
2 changed files with 8 additions and 20 deletions
|
@ -86,11 +86,6 @@
|
||||||
|
|
||||||
(s/def ::options-mode #{:design :prototype})
|
(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
|
(def workspace-local-default
|
||||||
{:zoom 1
|
{:zoom 1
|
||||||
:flags #{}
|
:flags #{}
|
||||||
|
@ -123,8 +118,7 @@
|
||||||
ptk/UpdateEvent
|
ptk/UpdateEvent
|
||||||
(update [_ state]
|
(update [_ state]
|
||||||
(assoc state
|
(assoc state
|
||||||
:workspace-presence {}
|
:workspace-presence {}))
|
||||||
:workspace-file-local workspace-file-local-default))
|
|
||||||
|
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ state stream]
|
(watch [_ state stream]
|
||||||
|
@ -373,9 +367,9 @@
|
||||||
:document-history
|
:document-history
|
||||||
:assets])))
|
:assets])))
|
||||||
right-sidebar? (not (empty? (keep layout [:element-options])))]
|
right-sidebar? (not (empty? (keep layout [:element-options])))]
|
||||||
(update-in state [:workspace-local]
|
(update state :workspace-local
|
||||||
assoc :left-sidebar? left-sidebar?
|
assoc :left-sidebar? left-sidebar?
|
||||||
:right-sidebar? right-sidebar?)))
|
:right-sidebar? right-sidebar?)))
|
||||||
|
|
||||||
(defn- check-auto-flags
|
(defn- check-auto-flags
|
||||||
[state flags-to-toggle]
|
[state flags-to-toggle]
|
||||||
|
@ -401,8 +395,8 @@
|
||||||
ptk/UpdateEvent
|
ptk/UpdateEvent
|
||||||
(update [_ state]
|
(update [_ state]
|
||||||
(-> (reduce toggle-layout-flag state flags)
|
(-> (reduce toggle-layout-flag state flags)
|
||||||
(check-sidebars)
|
(check-auto-flags flags)
|
||||||
(check-auto-flags flags)))))
|
(check-sidebars)))))
|
||||||
|
|
||||||
;; --- Set element options mode
|
;; --- Set element options mode
|
||||||
|
|
||||||
|
|
|
@ -40,18 +40,12 @@
|
||||||
;; ---- Workspace refs
|
;; ---- Workspace refs
|
||||||
|
|
||||||
|
|
||||||
;; (def workspace-local
|
(def workspace-local
|
||||||
;; (l/derived :workspace-local st/state))
|
(l/derived :workspace-local st/state))
|
||||||
|
|
||||||
(def workspace-drawing
|
(def workspace-drawing
|
||||||
(l/derived :workspace-drawing st/state))
|
(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
|
(def selected-shapes
|
||||||
(l/derived :selected workspace-local))
|
(l/derived :selected workspace-local))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue