0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-25 00:06:09 -05:00

Merge pull request #3582 from penpot/superalex-fix-invalid-comments-when-delete-page

🐛 Fix deleted pages comments shown in right sidebar
This commit is contained in:
Andrey Antukh 2023-08-31 20:02:00 +02:00 committed by GitHub
commit 95d80c9578
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -279,8 +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 [pages (get-in state [:workspace-data :pages-index])
comments (filter #(some? (get pages (:page-id %))) comments)
(let [pages (-> (get-in state [:workspace-data :pages])
set)
comments (filter #(contains? 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)))]