0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-22 14:39:45 -05:00

🐛 Changing pages while comments activated will not close the panel

This commit is contained in:
alonso.torres 2022-01-10 18:18:07 +01:00
parent 50fd44d3f2
commit e5430259e9
3 changed files with 15 additions and 13 deletions

View file

@ -44,6 +44,7 @@
- Right click over artboard name to open its menu [Taiga #1679](https://tree.taiga.io/project/penpot/issue/1679)
- Make the default session cookue use SameSite=Lax instead of Strict (causes some issues in latest versions of Chrome).
- Fix "open in new tab" on dashboard [Taiga #2235](https://tree.taiga.io/project/penpot/issue/2355)
- Changing pages while comments activated will not close the panel [#1350](https://github.com/penpot/penpot/issues/1350)
- Fix navigate comments in right sidebar [Taiga #2163](https://tree.taiga.io/project/penpot/issue/2163)
### :arrow_up: Deps updates

View file

@ -282,10 +282,13 @@
(let [local (-> (:workspace-local state)
(dissoc :edition
:edit-path
:selected))]
(-> state
(assoc-in [:workspace-cache page-id] local)
(dissoc :current-page-id :workspace-local :trimmed-page :workspace-drawing))))))
:selected))
exit-workspace? (not= :workspace (get-in state [:route :data :name]))]
(cond-> (assoc-in state [:workspace-cache page-id] local)
:always
(dissoc :current-page-id :workspace-local :trimmed-page)
exit-workspace?
(dissoc :workspace-drawing))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Workspace Page CRUD
@ -445,7 +448,7 @@
:y (+ (:y srect) (/ (- (:height srect) height) 2)))))))
(setup [state local]
(if (and (:vbox local) (:vport local))
(if (and (:vport local) (:vbox local))
(update* local)
(initialize state local)))]

View file

@ -76,14 +76,12 @@
(update [_ state]
(update state :workspace-local
(fn [{:keys [vbox zoom] :as local}]
(let [pw (/ 50 zoom)
ph (/ 200 zoom)
(let [pw (/ 160 zoom)
ph (/ 160 zoom)
nw (mth/round (- (/ (:width vbox) 2) pw))
nh (mth/round (- (/ (:height vbox) 2) ph))
nx (- (:x position) nw)
ny (- (:y position) nh)]
(update local :vbox assoc :x nx :y ny)))))))
(defn navigate