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) - 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). - 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) - 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) - Fix navigate comments in right sidebar [Taiga #2163](https://tree.taiga.io/project/penpot/issue/2163)
### :arrow_up: Deps updates ### :arrow_up: Deps updates

View file

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

View file

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