🐛 Fix deleted pages comments shown in right sidebar

This commit is contained in:
Alejandro Alonso 2023-08-29 12:35:44 +02:00 committed by Andrey Antukh
parent 514ba6604b
commit 53d1624f3f
2 changed files with 4 additions and 1 deletions

View file

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