Skip to content

Commit

Permalink
fix: in forward search field, user cannot be found by name (Full Name) (
Browse files Browse the repository at this point in the history
  • Loading branch information
Rottenblasters authored and debdutdeb committed Oct 26, 2023
1 parent 753b5ed commit 6b3ba51
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/quiet-phones-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---

Search users using full name too on share message modal
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,16 @@ const UserAndRoomAutoCompleteMultiple = ({ value, onChange, ...props }: UserAndR
const debouncedFilter = useDebouncedValue(filter, 1000);

const rooms = useUserSubscriptions(
useMemo(() => ({ open: { $ne: false }, lowerCaseName: new RegExp(escapeRegExp(debouncedFilter), 'i') }), [debouncedFilter]),
useMemo(
() => ({
open: { $ne: false },
$or: [
{ lowerCaseFName: new RegExp(escapeRegExp(debouncedFilter), 'i') },
{ lowerCaseName: new RegExp(escapeRegExp(debouncedFilter), 'i') },
],
}),
[debouncedFilter],
),
).filter((room) => {
if (!user) {
return;
Expand Down

0 comments on commit 6b3ba51

Please sign in to comment.