From 45dd31cd713afdc0cf667b3966e4b70a93f54d97 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Thu, 10 Nov 2022 16:59:27 -0300 Subject: [PATCH] Regression: Remove users already in local database (#4673) --- app/lib/methods/search.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/methods/search.ts b/app/lib/methods/search.ts index 5a3c0433a..ac4e265e2 100644 --- a/app/lib/methods/search.ts +++ b/app/lib/methods/search.ts @@ -97,7 +97,7 @@ export const search = async ({ text = '', filterUsers = true, filterRooms = true if (filterUsers) { users .filter((item1, index) => users.findIndex(item2 => item2._id === item1._id) === index) // Remove duplicated data from response - .filter(user => !data.some(sub => 'username' in sub && user.username === sub.username)) // Make sure to remove users already on local database + .filter(user => !data.some(sub => user.username === sub.name)) // Make sure to remove users already on local database .forEach(user => { data.push({ ...user,