mirror of
https://github.com/penpot/penpot.git
synced 2025-03-12 07:41:43 -05:00
🐛 Fix retrieve user comments in dashboard
This commit is contained in:
parent
872648d393
commit
fc35b0b853
4 changed files with 16 additions and 3 deletions
|
@ -72,6 +72,7 @@
|
|||
- Fix bad frame-id for certain componentes [#3205](https://github.com/penpot/penpot/issues/3205)
|
||||
- Fix paste elements at bottom of frame [Taig #5253](https://tree.taiga.io/project/penpot/issue/5253)
|
||||
- Fix new-file button on project not redirecting to the new file [Taiga #5610](https://tree.taiga.io/project/penpot/issue/5610)
|
||||
- Fix retrieve user comments in dashboard [Taiga #5607](https://tree.taiga.io/project/penpot/issue/5607)
|
||||
|
||||
### :arrow_up: Deps updates
|
||||
|
||||
|
|
|
@ -314,9 +314,18 @@
|
|||
(ptk/reify ::retrieve-unread-comment-threads
|
||||
ptk/WatchEvent
|
||||
(watch [_ _ _]
|
||||
(let [fetched #(assoc %2 :comment-threads (d/index-by :id %1))]
|
||||
(let [fetched-comments #(assoc %2 :comment-threads (d/index-by :id %1))
|
||||
fetched-users #(assoc %2 :current-team-comments-users %1)]
|
||||
(->> (rp/cmd! :get-unread-comment-threads {:team-id team-id})
|
||||
(rx/map #(partial fetched %))
|
||||
(rx/merge-map
|
||||
(fn [comments]
|
||||
(rx/concat
|
||||
(rx/of (partial fetched-comments comments))
|
||||
|
||||
(->> (rx/from (map :file-id comments))
|
||||
(rx/merge-map #(rp/cmd! :get-profiles-for-file-comments {:file-id %}))
|
||||
(rx/reduce #(merge %1 (d/index-by :id %2)) {})
|
||||
(rx/map #(partial fetched-users %))))))
|
||||
(rx/catch #(rx/throw {:type :comment-error})))))))
|
||||
|
||||
|
||||
|
|
|
@ -459,6 +459,9 @@
|
|||
(def current-file-comments-users
|
||||
(l/derived :current-file-comments-users st/state))
|
||||
|
||||
(def current-team-comments-users
|
||||
(l/derived :current-team-comments-users st/state))
|
||||
|
||||
(def viewer-fullscreen?
|
||||
(l/derived (fn [state]
|
||||
(dm/get-in state [:viewer-local :fullscreen?]))
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
show-dropdown (mf/use-fn #(reset! show-dropdown? true))
|
||||
hide-dropdown (mf/use-fn #(reset! show-dropdown? false))
|
||||
threads-map (mf/deref refs/comment-threads)
|
||||
users (mf/deref refs/current-file-comments-users)
|
||||
users (mf/deref refs/current-team-comments-users)
|
||||
|
||||
tgroups (->> (vals threads-map)
|
||||
(sort-by :modified-at)
|
||||
|
|
Loading…
Add table
Reference in a new issue