From 53d1624f3f848d025d7a4fe3341ff820aae2b33b Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Tue, 29 Aug 2023 12:35:44 +0200 Subject: [PATCH] :bug: Fix deleted pages comments shown in right sidebar --- CHANGES.md | 1 + frontend/src/app/main/data/comments.cljs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 273773cb1..e9e98fa3a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,7 @@ - Fix unexpected output on get-page rpc method when invalid object-id is provided [Github #3546](https://github.com/penpot/penpot/issues/3546) - Fix Invalid files amount after moving file from Project to Drafts [Taiga #5638](https://tree.taiga.io/project/penpot/us/5638) +- Fix deleted pages comments shown in right sidebar [Taiga #5648](https://tree.taiga.io/project/penpot/us/5648) ## 1.19.1 diff --git a/frontend/src/app/main/data/comments.cljs b/frontend/src/app/main/data/comments.cljs index 46bf3c752..4ea5796be 100644 --- a/frontend/src/app/main/data/comments.cljs +++ b/frontend/src/app/main/data/comments.cljs @@ -279,7 +279,9 @@ (assoc-in (conj path :position) (:position comment-thread)) (assoc-in (conj path :frame-id) (:frame-id comment-thread)))))) (fetched [[users comments] state] - (let [state (-> state + (let [pages (get-in state [:workspace-data :pages-index]) + comments (filter #(some? (get pages (:page-id %))) comments) + state (-> state (assoc :comment-threads (d/index-by :id comments)) (update :current-file-comments-users merge (d/index-by :id users)))] (reduce set-comment-threds state comments)))]