[FIX] Searching for users when creating Discussions (#4267)

This commit is contained in:
Reinaldo Neto 2022-06-13 10:15:22 -03:00 committed by GitHub
parent 5899b1f789
commit a21c797886
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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 {