mirror of
https://github.com/penpot/penpot.git
synced 2025-05-31 17:26:18 +02:00
🐛 Fix users from another teams appear in mentions (#5789)
This commit is contained in:
parent
b991a94685
commit
92aa615da4
1 changed files with 10 additions and 7 deletions
|
@ -425,7 +425,9 @@
|
||||||
[]
|
[]
|
||||||
(let [mentions-s (mf/use-ctx mentions-context)
|
(let [mentions-s (mf/use-ctx mentions-context)
|
||||||
profile (mf/deref refs/profile)
|
profile (mf/deref refs/profile)
|
||||||
profiles (mf/deref refs/profiles)
|
|
||||||
|
team (mf/deref refs/team)
|
||||||
|
members (:members team)
|
||||||
|
|
||||||
state*
|
state*
|
||||||
(mf/use-state
|
(mf/use-state
|
||||||
|
@ -437,10 +439,8 @@
|
||||||
(deref state*)
|
(deref state*)
|
||||||
|
|
||||||
mentions-users
|
mentions-users
|
||||||
(mf/with-memo [mention-filter]
|
(mf/with-memo [mention-filter members]
|
||||||
|
(->> members
|
||||||
|
|
||||||
(->> (vals profiles)
|
|
||||||
(filter (fn [{:keys [id fullname email]}]
|
(filter (fn [{:keys [id fullname email]}]
|
||||||
(and
|
(and
|
||||||
(not= id (:id profile))
|
(not= id (:id profile))
|
||||||
|
@ -461,9 +461,12 @@
|
||||||
(dom/stop-propagation event)
|
(dom/stop-propagation event)
|
||||||
(let [id (-> (dom/get-current-target event)
|
(let [id (-> (dom/get-current-target event)
|
||||||
(dom/get-data "user-id")
|
(dom/get-data "user-id")
|
||||||
(uuid/uuid))]
|
(uuid/uuid))
|
||||||
|
|
||||||
|
user (d/seek #(= (:id %) id) members)]
|
||||||
|
|
||||||
(rx/push! mentions-s {:type :insert-mention
|
(rx/push! mentions-s {:type :insert-mention
|
||||||
:data {:user (get profiles id)}}))))]
|
:data {:user user}}))))]
|
||||||
|
|
||||||
(mf/with-effect [mentions-users selected]
|
(mf/with-effect [mentions-users selected]
|
||||||
(let [sub
|
(let [sub
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue