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

🐛 Fix deleted pages comments shown in right sidebar

This commit is contained in:
Alejandro Alonso 2023-08-31 15:16:55 +02:00
parent c53b6117c0
commit 0c5c04e58a

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)))]