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 {