diff --git a/app/views/CreateDiscussionView/SelectUsers.tsx b/app/views/CreateDiscussionView/SelectUsers.tsx index f82973a82..26c3291d9 100644 --- a/app/views/CreateDiscussionView/SelectUsers.tsx +++ b/app/views/CreateDiscussionView/SelectUsers.tsx @@ -32,7 +32,10 @@ const SelectUsers = ({ const getUsers = debounce(async (keyword = '') => { try { const res = await RocketChat.search({ text: keyword, filterRooms: false }); - setUsers(res); + const selectedUsers = users.filter((u: IUser) => selected.includes(u.name)); + const filteredUsers = res.filter(r => !users.find((u: IUser) => u.name === r.name)); + const items = [...selectedUsers, ...filteredUsers]; + setUsers(items); } catch { // do nothing }