0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-01 02:06:53 -05:00

🐛 Fix mention users in viewer

This commit is contained in:
Luis de Dios 2025-02-25 15:35:48 +01:00
parent 06b5304926
commit c618efc29e

View file

@ -171,7 +171,7 @@
(declare go-to-frame-auto) (declare go-to-frame-auto)
(defn bundle-fetched (defn bundle-fetched
[{:keys [project file share-links libraries users permissions thumbnails] :as bundle}] [{:keys [project file team share-links libraries users permissions thumbnails] :as bundle}]
(let [pages (->> (dm/get-in file [:data :pages]) (let [pages (->> (dm/get-in file [:data :pages])
(map (fn [page-id] (map (fn [page-id]
(let [data (get-in file [:data :pages-index page-id])] (let [data (get-in file [:data :pages-index page-id])]
@ -183,15 +183,19 @@
(ptk/reify ::bundle-fetched (ptk/reify ::bundle-fetched
ptk/UpdateEvent ptk/UpdateEvent
(update [_ state] (update [_ state]
(let [team-id (:id team)
team {:members users}]
(-> state (-> state
(assoc :share-links share-links) (assoc :share-links share-links)
(assoc :current-team-id team-id)
(assoc :teams {team-id team})
(assoc :viewer {:libraries (d/index-by :id libraries) (assoc :viewer {:libraries (d/index-by :id libraries)
:users (d/index-by :id users) :users (d/index-by :id users)
:permissions permissions :permissions permissions
:project project :project project
:pages pages :pages pages
:thumbnails thumbnails :thumbnails thumbnails
:file file}))) :file file}))))
ptk/WatchEvent ptk/WatchEvent
(watch [_ state _] (watch [_ state _]