Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: in forward search field, user cannot be found by name (Full Name) #29663

Merged
merged 11 commits into from
Oct 3, 2023
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
Loading