From a21c7978865fae607219ab49e27896dbc8ccd358 Mon Sep 17 00:00:00 2001 From: Reinaldo Neto <47038980+reinaldonetof@users.noreply.github.com> Date: Mon, 13 Jun 2022 10:15:22 -0300 Subject: [PATCH] [FIX] Searching for users when creating Discussions (#4267) --- app/views/CreateDiscussionView/SelectUsers.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/CreateDiscussionView/SelectUsers.tsx b/app/views/CreateDiscussionView/SelectUsers.tsx index 7cb3a98cb..094c46c02 100644 --- a/app/views/CreateDiscussionView/SelectUsers.tsx +++ b/app/views/CreateDiscussionView/SelectUsers.tsx @@ -28,7 +28,7 @@ const SelectUsers = ({ try { const res = await search({ text: keyword, filterRooms: false }); const selectedUsers = users.filter((u: IUser) => selected.includes(u.name)); - const filteredUsers = res.filter(r => !users.find((u: IUser) => u.name === r.name)); + const filteredUsers = res.filter(r => !selectedUsers.find((u: IUser) => u.name === r.name)); const items = [...selectedUsers, ...filteredUsers]; setUsers(items); } catch {