0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-11 06:21:30 -05:00

🐛 Fix users from another teams appear in mentions (#5789)

This commit is contained in:
luisδμ 2025-02-07 12:33:29 +01:00 committed by GitHub
parent b991a94685
commit 92aa615da4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -425,7 +425,9 @@
[]
(let [mentions-s (mf/use-ctx mentions-context)
profile (mf/deref refs/profile)
profiles (mf/deref refs/profiles)
team (mf/deref refs/team)
members (:members team)
state*
(mf/use-state
@ -437,10 +439,8 @@
(deref state*)
mentions-users
(mf/with-memo [mention-filter]
(->> (vals profiles)
(mf/with-memo [mention-filter members]
(->> members
(filter (fn [{:keys [id fullname email]}]
(and
(not= id (:id profile))
@ -461,9 +461,12 @@
(dom/stop-propagation event)
(let [id (-> (dom/get-current-target event)
(dom/get-data "user-id")
(uuid/uuid))]
(uuid/uuid))
user (d/seek #(= (:id %) id) members)]
(rx/push! mentions-s {:type :insert-mention
:data {:user (get profiles id)}}))))]
:data {:user user}}))))]
(mf/with-effect [mentions-users selected]
(let [sub